Skip to main content

ThreadPoolTaskHandler

A task handler that manages dependencies and executes tasks in a thread pool.

all_tasks_completed

Check if all tasks are completed. Returns
  • bool: True if all tasks are completed, False otherwise.

get_children

Get the children of a task.

get_result

Get result if task completed, otherwise raises exception.

get_retry_count

Get the retry count for a task.

get_status

Returns the status of a task. Arguments
  • task_id (str): The ID of the task.
Returns
  • TaskStatus: The status of the task.

increment_retry

Increment the retry count for a task. Arguments
  • task_id (str): The ID of the task.

submit_task

Submit a task to the thread pool. Arguments
  • task_id (str): The ID of the task.
  • async_fn (Union[Callable[[], Awaitable[Any]], Coroutine]): The async function to submit to the thread pool.
  • dependent_on_prev (bool): Whether the task depends on the previous task.

submit_task_with_parent

Submit a task that depends on a specific parent task. Arguments
  • task_id (str): The ID of the task.
  • async_fn (Union[Callable[[], Awaitable[Any]], Coroutine]): The async function to submit to the thread pool.
  • parent_task_id (str): The ID of the parent task this depends on.