taipy.core.Task
Bases: _Entity
Hold a user function that will be executed, its parameters and the results.
A Task
brings together the user code as function, the inputs and the outputs as data nodes
(instances of the DataNode
class).
Attributes:
Name | Type | Description |
---|---|---|
config_id |
str
|
The identifier of the |
function |
callable
|
The python function to execute. The function must take as parameter the data referenced by inputs data nodes, and must return the data referenced by outputs data nodes. |
input |
Union[DataNode, List[DataNode]]
|
The list of inputs. |
output |
Union[DataNode, List[DataNode]]
|
The list of outputs. |
id |
str
|
The unique identifier of the task. |
parent_id |
str
|
The identifier of the parent (pipeline_id, scenario_id, cycle_id) or None. |
scope: Scope
property
¶
Retrieve the lowest scope of the task based on its data nodes.
Returns:
Type | Description |
---|---|
Scope
|
Scope^: Lowest scope present in input and output data nodes or GLOBAL if there are either no input or no output. |
submit(callbacks=None, force=False, wait=False, timeout=None)
¶
Submit the task for execution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
callbacks |
List[Callable]
|
The list of callable functions to be called on status change. |
None
|
force |
bool
|
Force execution even if the data nodes are in cache. |
False
|
wait |
bool
|
Wait for the scheduled job created from the task submission to be finished in asynchronous mode. |
False
|
timeout |
Union[float, int]
|
The maximum number of seconds to wait for the job to be finished before returning. |
None
|