PythonTask

class PythonTask

Bases: AsyncTask

This class exists to allow association of a Python function or coroutine with the AsyncTaskManager.

Inheritance diagram

Inheritance diagram of PythonTask

PythonTask(PyObject *function = (&::_Py_NoneStruct), std::string const &name = string())
PythonTask(PythonTask const&) = default
PyObject *get_args(void)
static TypeHandle get_class_type(void)
PyObject *get_function(void)

Returns the function that is called when the task runs.

PyObject *get_owner(void) const

Returns the “owner” object. See set_owner().

PyObject *get_upon_death(void)

Returns the function that is called when the task finishes.

void set_args(PyObject *args, bool append_task)
void set_function(PyObject *function)
void set_owner(PyObject *owner)
void set_result(PyObject *result)

Sets the “result” of this task. This is the value returned from an “await” expression on this task. This can only be called while the task is still alive.

void set_upon_death(PyObject *upon_death)
bool validate_ptr(void const *ptr)