Table of Contents

Interface IOrchestrationService

Namespace
DurableTask.Core
Assembly
DurableTask.Core.dll

Orchestration Service interface for performing task hub management operations and handling orchestrations and work items' state

public interface IOrchestrationService

Properties

EventBehaviourForContinueAsNew

Should we carry over unexecuted raised events to the next iteration of an orchestration on ContinueAsNew

BehaviorOnContinueAsNew EventBehaviourForContinueAsNew { get; }

Property Value

BehaviorOnContinueAsNew

MaxConcurrentTaskActivityWorkItems

Gets the maximum number of concurrent task activity items

int MaxConcurrentTaskActivityWorkItems { get; }

Property Value

int

MaxConcurrentTaskOrchestrationWorkItems

Gets the maximum number of concurrent task orchestration items

int MaxConcurrentTaskOrchestrationWorkItems { get; }

Property Value

int

TaskActivityDispatcherCount

Gets the number of task activity dispatchers

int TaskActivityDispatcherCount { get; }

Property Value

int

TaskOrchestrationDispatcherCount

Gets the number of task orchestration dispatchers

int TaskOrchestrationDispatcherCount { get; }

Property Value

int

Methods

AbandonTaskActivityWorkItemAsync(TaskActivityWorkItem)

Abandons a single work item and releases the lock on it

Task AbandonTaskActivityWorkItemAsync(TaskActivityWorkItem workItem)

Parameters

workItem TaskActivityWorkItem

Returns

Task

AbandonTaskOrchestrationWorkItemAsync(TaskOrchestrationWorkItem)

Abandon an orchestration, this abandons ownership/locking of all messages for an orchestration and it's session

Task AbandonTaskOrchestrationWorkItemAsync(TaskOrchestrationWorkItem workItem)

Parameters

workItem TaskOrchestrationWorkItem

Returns

Task

CompleteTaskActivityWorkItemAsync(TaskActivityWorkItem, TaskMessage)

Atomically complete a work item and send the response messages

Task CompleteTaskActivityWorkItemAsync(TaskActivityWorkItem workItem, TaskMessage responseMessage)

Parameters

workItem TaskActivityWorkItem
responseMessage TaskMessage

Returns

Task

CompleteTaskOrchestrationWorkItemAsync(TaskOrchestrationWorkItem, OrchestrationRuntimeState, IList<TaskMessage>, IList<TaskMessage>, IList<TaskMessage>, TaskMessage, OrchestrationState)

Complete an orchestration, send any outbound messages and completes the session for all current messages

Task CompleteTaskOrchestrationWorkItemAsync(TaskOrchestrationWorkItem workItem, OrchestrationRuntimeState newOrchestrationRuntimeState, IList<TaskMessage> outboundMessages, IList<TaskMessage> orchestratorMessages, IList<TaskMessage> timerMessages, TaskMessage continuedAsNewMessage, OrchestrationState orchestrationState)

Parameters

workItem TaskOrchestrationWorkItem
newOrchestrationRuntimeState OrchestrationRuntimeState
outboundMessages IList<TaskMessage>
orchestratorMessages IList<TaskMessage>
timerMessages IList<TaskMessage>
continuedAsNewMessage TaskMessage
orchestrationState OrchestrationState

Returns

Task

CreateAsync()

Deletes and Creates the necessary resources for the orchestration service and the instance store

Task CreateAsync()

Returns

Task

CreateAsync(bool)

Deletes and Creates the necessary resources for the orchestration service and optionally the instance store

Task CreateAsync(bool recreateInstanceStore)

Parameters

recreateInstanceStore bool

Returns

Task

CreateIfNotExistsAsync()

Creates the necessary resources for the orchestration service and the instance store

Task CreateIfNotExistsAsync()

Returns

Task

DeleteAsync()

Deletes the resources for the orchestration service and the instance store

Task DeleteAsync()

Returns

Task

DeleteAsync(bool)

Deletes the resources for the orchestration service and optionally the instance store

Task DeleteAsync(bool deleteInstanceStore)

Parameters

deleteInstanceStore bool

Returns

Task

GetDelayInSecondsAfterOnFetchException(Exception)

Inspects an exception to get a custom delay based on the exception (e.g. transient) properties for a fetch exception

int GetDelayInSecondsAfterOnFetchException(Exception exception)

Parameters

exception Exception

Returns

int

GetDelayInSecondsAfterOnProcessException(Exception)

Inspects an exception to get a custom delay based on the exception (e.g. transient) properties for a process exception

int GetDelayInSecondsAfterOnProcessException(Exception exception)

Parameters

exception Exception

Returns

int

IsMaxMessageCountExceeded(int, OrchestrationRuntimeState)

Checks the message count against the threshold to see if a limit is being exceeded

bool IsMaxMessageCountExceeded(int currentMessageCount, OrchestrationRuntimeState runtimeState)

Parameters

currentMessageCount int
runtimeState OrchestrationRuntimeState

Returns

bool

LockNextTaskActivityWorkItem(TimeSpan, CancellationToken)

Wait for an lock the next task activity to be processed

Task<TaskActivityWorkItem> LockNextTaskActivityWorkItem(TimeSpan receiveTimeout, CancellationToken cancellationToken)

Parameters

receiveTimeout TimeSpan
cancellationToken CancellationToken

Returns

Task<TaskActivityWorkItem>

LockNextTaskOrchestrationWorkItemAsync(TimeSpan, CancellationToken)

Wait for the next orchestration work item and return the orchestration work item

Task<TaskOrchestrationWorkItem> LockNextTaskOrchestrationWorkItemAsync(TimeSpan receiveTimeout, CancellationToken cancellationToken)

Parameters

receiveTimeout TimeSpan
cancellationToken CancellationToken

Returns

Task<TaskOrchestrationWorkItem>

ReleaseTaskOrchestrationWorkItemAsync(TaskOrchestrationWorkItem)

Release the lock on an orchestration, releases the session, decoupled from CompleteTaskOrchestrationWorkItemAsync to handle nested orchestrations

Task ReleaseTaskOrchestrationWorkItemAsync(TaskOrchestrationWorkItem workItem)

Parameters

workItem TaskOrchestrationWorkItem

Returns

Task

RenewTaskActivityWorkItemLockAsync(TaskActivityWorkItem)

Renew the lock on a still processing work item

Task<TaskActivityWorkItem> RenewTaskActivityWorkItemLockAsync(TaskActivityWorkItem workItem)

Parameters

workItem TaskActivityWorkItem

Returns

Task<TaskActivityWorkItem>

RenewTaskOrchestrationWorkItemLockAsync(TaskOrchestrationWorkItem)

Renew the lock on an orchestration

Task RenewTaskOrchestrationWorkItemLockAsync(TaskOrchestrationWorkItem workItem)

Parameters

workItem TaskOrchestrationWorkItem

Returns

Task

StartAsync()

Starts the service initializing the required resources

Task StartAsync()

Returns

Task

StopAsync()

Stops the orchestration service gracefully

Task StopAsync()

Returns

Task

StopAsync(bool)

Stops the orchestration service with optional forced flag

Task StopAsync(bool isForced)

Parameters

isForced bool

Returns

Task