Executor component manager

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

class TaskExecutorComponentManager(*args: Any, max_queue_size: int = 32, **kwargs: Any)[source]

A component manager with support for asynchronous tasking.

property max_queued_tasks: int

Get the task queue size.

Returns:

The task queue size

submit_task(func: Callable[[...], None], 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