Executor component manager

This module provides an abstract component manager for SKA Tango base devices.

class TaskExecutorComponentManager[source]

A component manager with support for asynchronous tasking.

__init__(*args: Any, max_queue_size: int = 32, **kwargs: Any) None[source]

Initialise a new ComponentManager instance.

Parameters:
  • args – additional positional arguments

  • max_queue_size – optional maximum size of the tasks input queue

  • kwargs – additional keyword arguments

cleanup() None[source]

Shutdown the task executor.

property max_queued_tasks: int

Get the task queue size.

Returns:

The task queue size

submit_task(func: TaskFunctionType, args: Any | None = None, kwargs: Any | None = None, is_cmd_allowed: Callable[[], bool] | None = None, task_callback: TaskCallbackType | None = None) tuple[TaskStatus, str][source]

Submit a task to the task executor.

Parameters:
  • func – function/bound method to be run

  • args – positional arguments to the function

  • kwargs – keyword arguments to the function

  • is_cmd_allowed – sanity check for func

  • task_callback – callback to be called whenever the status of the task changes.

Returns:

tuple of TaskStatus & message

abort_tasks(task_callback: TaskCallbackType | None = None) tuple[TaskStatus, str][source]

Tell the task executor to abort all tasks.

Parameters:

task_callback – callback to be called whenever the status of this abort task changes.

Returns:

tuple of TaskStatus & message