@@ -48,7 +48,7 @@ PYBIND11_MODULE(taskr, m)
4848 .def (" setServiceWorkerCallbackHandler" , &Runtime::setServiceWorkerCallbackHandler)
4949 .def (" setTaskWorkerCallbackHandler" , &Runtime::setTaskWorkerCallbackHandler)
5050 .def (" initialize" , &Runtime::initialize)
51- .def (" addTask" , &Runtime::addTask, py::keep_alive<1 , 2 >()) // keep_alive as the task should be alive until runtime's destructor
51+ .def (" addTask" , &Runtime::addTask, py::keep_alive<1 , 2 >(), py::arg ( " task " ) ) // keep_alive as the task should be alive until runtime's destructor
5252 .def (" resumeTask" , &Runtime::resumeTask)
5353 .def (" run" , &Runtime::run, py::call_guard<py::gil_scoped_release>())
5454 .def (" await_" , &Runtime::await, py::call_guard<py::gil_scoped_release>()) // Release GIL is important otherwise non-finished tasks are getting blocked
@@ -57,12 +57,12 @@ PYBIND11_MODULE(taskr, m)
5757 .def (" addService" , &Runtime::addService);
5858
5959 // TaskR's Function class
60- py::class_<Function>(m, " Function" ).def (py::init<const function_t >());
60+ py::class_<Function>(m, " Function" ).def (py::init<const function_t >(), py::arg ( " fc " ) );
6161
6262 // TaskR's Task class
6363 py::class_<Task>(m, " Task" )
6464 .def (py::init<Function *, const workerId_t>(), py::arg (" fc" ), py::arg (" workerAffinity" ) = -1 )
65- .def (py::init<const label_t , Function *, const workerId_t>(), py::arg (" label" ), py::arg (" fc " ), py::arg (" workerAffinity" ) = -1 )
65+ .def (py::init<const label_t , Function *, const workerId_t>(), py::arg (" label" ), py::arg (" taskfc " ), py::arg (" workerAffinity" ) = -1 )
6666 .def (" getLabel" , &Task::getLabel)
6767 .def (" setLabel" , &Task::setLabel)
6868 .def (" getWorkerAffinity" , &Task::getWorkerAffinity)
0 commit comments