Task Class
Represents some pending action.
Similar to a native JavaScript promise in that it acts as a placeholder for outstanding asynchronous work, but has a synchronous implementation and is specific to Durable Functions.
Tasks are only returned to an orchestration function when a [[DurableOrchestrationContext]] operation is not called with yield. They are useful for parallelization and timeout operations in conjunction with Task.all and Task.any.
- Inheritance
-
builtins.objectTask
Constructor
Task(is_completed, is_faulted, action, result=None, timestamp=None, id_=None, exc=None, is_played=False)
Parameters
Name | Description |
---|---|
is_completed
Required
|
|
is_faulted
Required
|
|
action
Required
|
|
result
|
Default value: None
|
timestamp
|
Default value: None
|
id_
|
Default value: None
|
exc
|
Default value: None
|
is_played
|
Default value: False
|
Attributes
action
Get the scheduled action represented by the task.
Internal use only.
exception
Get the error thrown when attempting to perform the task's action.
If the Task has not yet completed or has completed successfully, None
id
Get the ID number of the task.
Internal use only.
is_completed
Get indicator whether the task has completed.
Note that completion is not equivalent to success.
is_faulted
Get indicator whether the task faulted in some way due to error.
result
Get the result of the task, if completed. Otherwise None.
timestamp
Get the timestamp of the task.
Azure SDK for Python
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for