dragon.workflows.batch.batch.Task
- class Task[source]
Bases:
object- __init__(task_core: TaskCore, batch: Batch, reads: list | None = None, writes: list | None = None, compiled: bool = False) None [source]
Initializes a new task.
- Parameters:
task_core (
TaskCore) – The core parts of the task, allowing us to send leaner objects to the managers.batch (
Batch) – The batch to which this task belongs.reads (Optional[list ]) – A list of
Readobjects created by callingBatch.read().writes (Optional[list ]) – A list of
Writeobjects created by callingBatch.write().compiled (bool ) – A flag indicating if this task is compiled.
- Returns:
Returns None.
- Return type:
None
Methods
__init__(task_core, batch[, reads, writes, ...])Initializes a new task.
dump_dag(file_name)Dump a PNG image of the dependency DAG associated with a compiled program.
get([block, timeout])Wait for this Task to complete.
Attributes
Provides the unique ID for this task.
- __init__(task_core: TaskCore, batch: Batch, reads: list | None = None, writes: list | None = None, compiled: bool = False) None [source]
Initializes a new task.
- Parameters:
task_core (
TaskCore) – The core parts of the task, allowing us to send leaner objects to the managers.batch (
Batch) – The batch to which this task belongs.reads (Optional[list ]) – A list of
Readobjects created by callingBatch.read().writes (Optional[list ]) – A list of
Writeobjects created by callingBatch.write().compiled (bool ) – A flag indicating if this task is compiled.
- Returns:
Returns None.
- Return type:
None
- get(block: bool = True, timeout: float = 1000000000.0) None [source]
Wait for this Task to complete. This function returns the task’s result and prints any stdout/stderr output.
- Parameters:
- Raises:
TimeoutError – If the specified timeout is exceeded.
:raises
TaskNotReadyError: If block is False and the result is not yet available.- Returns:
Returns the result of the task.
- Return type:
Any
- property uid
Provides the unique ID for this task.