qmi.core.context_singleton.make_task
- qmi.core.context_singleton.make_task(task_name: str, task_class: type[~qmi.core.task.QMI_Task], *args: ~typing.Any, task_runner: type[~qmi.core.task.QMI_TaskRunner] = <class 'qmi.core.task.QMI_TaskRunner'>, **kwargs: ~typing.Any) Any
Create an instance of a QMI_Task subclass and make it accessible via RPC.
The actual task instance will be created in a separate thread. A QMI_TaskRunner will be created to manage the task thread. The task can be accessed by calling the methods of the task runner via RPC.
Note that the task is not yet started. To start the task, perform an explicit call to the start() method of the returned task.
- Parameters:
task_name – Unique name for the new task instance. This name will also be used to access the task runner via RPC.
task_class – Class that implements this task (must be a subclass of QMI_Task).
args – Optional arguments for the task class constructor.
task_runner – Class that implements the managing of the task (must be a subclass of QMI_Taskrunner)
kwargs – Optional keyword arguments for the task class constructor.
- Returns:
An RPC proxy that provides access to the new task.
- Raises:
QMI_NoActiveContextException – If there is no active QMI context present.