tasks Package
Contains the definitions for the functions that enable scheduling of activities.
Modules
Functions
call_activity_task
Determine the state of Scheduling an activity for execution.
call_activity_task(state: List[azure.durable_functions.models.history.HistoryEvent.HistoryEvent], name: str, input_: Optional[Any] = None) -> azure.durable_functions.models.Task.Task
Parameters
- state
- <xref:List>[HistoryEvent]
The list of history events to search to determine the current state of the activity.
- input
- <xref:Any>
The JSON-serializable input to pass to the activity function.
Returns
A Durable Task that completes when the called activity function completes or fails.
Return type
call_activity_with_retry_task
Determine the state of scheduling an activity for execution with retry options.
call_activity_with_retry_task(state: List[azure.durable_functions.models.history.HistoryEvent.HistoryEvent], retry_options: azure.durable_functions.models.RetryOptions.RetryOptions, name: str, input_: Optional[Any] = None) -> azure.durable_functions.models.Task.Task
Parameters
- state
- <xref:List>[HistoryEvent]
The list of history events to search to determine the current state of the activity.
- input
- <xref:Any>
The JSON-serializable input to pass to the activity function.
Returns
A Durable Task that completes when the called activity function completes or fails completely.
Return type
call_http
Get task used to schedule a durable HTTP call to the specified endpoint.
call_http(state: List[azure.durable_functions.models.history.HistoryEvent.HistoryEvent], method: str, uri: str, content: Optional[str] = None, headers: Optional[Dict[str, str]] = None, token_source: Optional[azure.durable_functions.models.TokenSource.TokenSource] = None) -> azure.durable_functions.models.Task.Task
Parameters
- state
- <xref:List>[HistoryEvent]
The list of events that have been processed to determine the state of the task to be scheduled
Returns
The durable HTTP request to schedule.
Return type
call_sub_orchestrator_task
Determine the state of Scheduling a sub-orchestrator for execution.
call_sub_orchestrator_task(context, state: List[azure.durable_functions.models.history.HistoryEvent.HistoryEvent], name: str, input_: Optional[Any] = None, instance_id: Optional[str] = None) -> azure.durable_functions.models.Task.Task
Parameters
- context
- <xref:<xref:'DurableOrchestrationContext':>>
A reference to the orchestration context.
- state
- <xref:List>[HistoryEvent]
The list of history events to search to determine the current state of the activity.
- input
- <xref:Optional>[<xref:Any>]
The JSON-serializable input to pass to the activity function. Defaults to None.
- instance_id
- str
The instance ID of the sub-orchestrator to call. Defaults to "".
Returns
A Durable Task that completes when the called sub-orchestrator completes or fails.
Return type
call_sub_orchestrator_with_retry_task
Determine the state of Scheduling a sub-orchestrator for execution, with retry options.
call_sub_orchestrator_with_retry_task(context, state: List[azure.durable_functions.models.history.HistoryEvent.HistoryEvent], retry_options: azure.durable_functions.models.RetryOptions.RetryOptions, name: str, input_: Optional[Any] = None, instance_id: Optional[str] = None) -> azure.durable_functions.models.Task.Task
Parameters
- context
- <xref:<xref:'DurableOrchestrationContext':>>
A reference to the orchestration context.
- state
- <xref:List>[HistoryEvent]
The list of history events to search to determine the current state of the activity.
- retry_options
- RetryOptions
The settings for retrying this sub-orchestrator in case of a failure.
- input
- <xref:Optional>[<xref:Any>]
The JSON-serializable input to pass to the activity function. Defaults to None.
- instance_id
- str
The instance ID of the sub-orchestrator to call. Defaults to "".
Returns
A Durable Task that completes when the called sub-orchestrator completes or fails.
Return type
continue_as_new
Create a new continue as new action.
continue_as_new(context, input_: Optional[Any] = None)
Parameters
- input
- <xref:Any>
The JSON-serializable input to pass to the activity function.
- input_
create_timer_task
Durable Timers are used in orchestrator function to implement delays.
create_timer_task(state: List[azure.durable_functions.models.history.HistoryEvent.HistoryEvent], fire_at: datetime.datetime) -> azure.durable_functions.tasks.timer_task.TimerTask
Parameters
- state
- <xref:List>[HistoryEvent]
The list of history events to search to determine the current state of the activity
Returns
A Durable Timer Task that schedules the timer to wake up the activity
Return type
new_uuid
Create a new UUID that is safe for replay within an orchestration or operation.
The default implementation of this method creates a name-based UUID using the algorithm from RFC 4122 §4.3. The name input used to generate this value is a combination of the orchestration instance ID and an internally managed sequence number.
new_uuid(context: DurableOrchestrationContext) -> str
Parameters
- context
- DurableOrchestrationContext
Provides reference to the instance id, current_utc_datetime and a new_uuid_counter attribute that is combined together to form that name that is used for the V5 UUID.
Returns
New UUID that is safe for replay within an orchestration or operation.
Return type
should_suspend
Check the state of the result to determine if the orchestration should suspend.
should_suspend(partial_result) -> bool
Parameters
- partial_result
task_all
Determine the state of scheduling the activities for execution with retry options.
task_all(tasks: List[azure.durable_functions.models.Task.Task])
Parameters
Returns
A Durable Task Set that reports the state of running all of the tasks within it.
Return type
task_any
Determine whether any of the given tasks is completed.
task_any(tasks)
Parameters
Returns
Returns a completed Durable Task Set if any of the tasks is completed. Returns a not completed Durable Task Set if none of the tasks are completed. Returns a faulted Taskset if all tasks are faulted
Return type
wait_for_external_event_task
Determine the state of a task that is waiting for an event to occur.
wait_for_external_event_task(state: List[azure.durable_functions.models.history.HistoryEvent.HistoryEvent], name: str) -> azure.durable_functions.models.Task.Task
Parameters
- state
- <xref:List>[HistoryEvent]
The list of history events to search to determine the current
- of the task.
- <xref:state>
Returns
Returns a completed task if the expected event was raised. Returns a not completed task if the expected event has not occurred yet.
Return type
call_http
Get task used to schedule a durable HTTP call to the specified endpoint.
call_http(state: List[azure.durable_functions.models.history.HistoryEvent.HistoryEvent], method: str, uri: str, content: Optional[str] = None, headers: Optional[Dict[str, str]] = None, token_source: Optional[azure.durable_functions.models.TokenSource.TokenSource] = None) -> azure.durable_functions.models.Task.Task
Parameters
- state
- <xref:List>[HistoryEvent]
The list of events that have been processed to determine the state of the task to be scheduled
Returns
The durable HTTP request to schedule.
Return type
continue_as_new
Create a new continue as new action.
continue_as_new(context, input_: Optional[Any] = None)
Parameters
- input
- <xref:Any>
The JSON-serializable input to pass to the activity function.
- input_
new_uuid
Create a new UUID that is safe for replay within an orchestration or operation.
The default implementation of this method creates a name-based UUID using the algorithm from RFC 4122 §4.3. The name input used to generate this value is a combination of the orchestration instance ID and an internally managed sequence number.
new_uuid(context: DurableOrchestrationContext) -> str
Parameters
- context
- DurableOrchestrationContext
Provides reference to the instance id, current_utc_datetime and a new_uuid_counter attribute that is combined together to form that name that is used for the V5 UUID.
Returns
New UUID that is safe for replay within an orchestration or operation.
Return type
task_all
Determine the state of scheduling the activities for execution with retry options.
task_all(tasks: List[azure.durable_functions.models.Task.Task])
Parameters
Returns
A Durable Task Set that reports the state of running all of the tasks within it.
Return type
task_any
Determine whether any of the given tasks is completed.
task_any(tasks)
Parameters
Returns
Returns a completed Durable Task Set if any of the tasks is completed. Returns a not completed Durable Task Set if none of the tasks are completed. Returns a faulted Taskset if all tasks are faulted
Return type
Feedback
Submit and view feedback for