![]() |
TaskManager acts on the tasks fetched from the task queues.
tfx.orchestration.experimental.core.task_manager.TaskManager(
mlmd_handle: tfx.orchestration.metadata.Metadata
,
task_queue: tfx.orchestration.experimental.core.task_queue.TaskQueue
,
max_active_task_schedulers: int,
max_dequeue_wait_secs: float = _MAX_DEQUEUE_WAIT_SECS,
process_all_queued_tasks_before_exit: bool = False
)
TaskManager instance can be used as a context manager:
Args | |
---|---|
mlmd_handle
|
ML metadata db connection. |
task_queue
|
Task queue. |
max_active_task_schedulers
|
Maximum number of task schedulers that can be active at once. |
max_dequeue_wait_secs
|
Maximum time to wait when dequeuing if the queue is empty. |
process_all_queued_tasks_before_exit
|
All existing items in the queues are processed before exiting the context manager. This is useful for deterministic behavior in tests. |
Methods
done
done() -> bool
Returns True
if the main task management thread has exited.
Raises | |
---|---|
RuntimeError
|
If done called without entering the task manager context.
|
exception
exception() -> Optional[BaseException]
Returns exception raised by the main task management thread (if any).
Raises | |
---|---|
RuntimeError
|
If exception called without entering the task manager
context or if the main thread is not done (done returns False ).
|
last_mlmd_publish_time
last_mlmd_publish_time() -> Optional[float]
Returns time-since-epoch of last MLMD publish; None
if never published.
__enter__
__enter__()
__exit__
__exit__(
exc_type, exc_val, exc_tb
)