DurableTaskClient Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Base class that defines client operations for managing durable task instances.
public abstract class DurableTaskClient : IAsyncDisposable, Microsoft.DurableTask.Internal.IOrchestrationSubmitter
type DurableTaskClient = class
interface IOrchestrationSubmitter
interface IAsyncDisposable
Public MustInherit Class DurableTaskClient
Implements IAsyncDisposable, IOrchestrationSubmitter
- Inheritance
-
DurableTaskClient
- Derived
- Implements
Remarks
Instances of DurableTaskClient can be used to start, query, raise events to, and terminate orchestration instances. In most cases, methods on this class accept an instance ID as a parameter, which identifies the orchestration instance.
At the time of writing, the most common implementation of this class is the gRPC client, which works by making gRPC calls to a remote service (e.g. a sidecar) that implements the operation behavior. To ensure any owned network resources are properly released, instances of DurableTaskClient should be disposed when they are no longer needed.
Instances of this class are expected to be safe for multithreaded apps. You can therefore safely cache instances of this class and reuse them across multiple contexts. Caching these objects is useful to improve overall performance.
Constructors
DurableTaskClient(String) |
Initializes a new instance of the DurableTaskClient class. |
Properties
Name |
Gets the name of the client. |
Methods
DisposeAsync() |
Disposes any unmanaged resources associated with this DurableTaskClient. |
GetAllInstancesAsync(OrchestrationQuery) |
Queries orchestration instances. |
GetInstancesAsync(String, Boolean, CancellationToken) |
Fetches orchestration instance metadata from the configured durable store. |
GetInstancesAsync(String, CancellationToken) |
Fetches orchestration instance metadata from the configured durable store. |
PurgeAllInstancesAsync(PurgeInstancesFilter, CancellationToken) |
Purges orchestration instances metadata from the durable store. |
PurgeInstanceAsync(String, CancellationToken) |
Purges orchestration instance metadata from the durable store. |
RaiseEventAsync(String, String, CancellationToken) |
Sends an event notification message to a waiting orchestration instance. |
RaiseEventAsync(String, String, Object, CancellationToken) |
Sends an event notification message to a waiting orchestration instance. |
ResumeInstanceAsync(String, CancellationToken) |
Resumes an orchestration instance that was suspended via SuspendInstanceAsync(String, String, CancellationToken). |
ResumeInstanceAsync(String, String, CancellationToken) |
Resumes an orchestration instance that was suspended via SuspendInstanceAsync(String, String, CancellationToken). |
ScheduleNewOrchestrationInstanceAsync(TaskName, CancellationToken) |
Schedules a new orchestration instance for execution. |
ScheduleNewOrchestrationInstanceAsync(TaskName, Object, CancellationToken) |
Schedules a new orchestration instance for execution. |
ScheduleNewOrchestrationInstanceAsync(TaskName, Object, StartOrchestrationOptions, CancellationToken) |
Schedules a new orchestration instance for execution. |
ScheduleNewOrchestrationInstanceAsync(TaskName, StartOrchestrationOptions, CancellationToken) |
Schedules a new orchestration instance for execution. |
SuspendInstanceAsync(String, CancellationToken) |
Suspends an orchestration instance, halting processing of it until ResumeInstanceAsync(String, String, CancellationToken) is used to resume the orchestration. |
SuspendInstanceAsync(String, String, CancellationToken) |
Suspends an orchestration instance, halting processing of it until ResumeInstanceAsync(String, String, CancellationToken) is used to resume the orchestration. |
TerminateInstanceAsync(String, CancellationToken) |
Terminates a running orchestration instance and updates its runtime status to Terminated. |
TerminateInstanceAsync(String, Object, CancellationToken) |
Terminates a running orchestration instance and updates its runtime status to Terminated. |
WaitForInstanceCompletionAsync(String, Boolean, CancellationToken) |
Waits for an orchestration to complete and returns a OrchestrationMetadata object that contains metadata about the started instance. |
WaitForInstanceCompletionAsync(String, CancellationToken) |
Waits for an orchestration to complete and returns a OrchestrationMetadata object that contains metadata about the started instance. |
WaitForInstanceStartAsync(String, Boolean, CancellationToken) |
Waits for an orchestration to start running and returns a OrchestrationMetadata object that contains metadata about the started instance. |
WaitForInstanceStartAsync(String, CancellationToken) |
Waits for an orchestration to start running and returns a OrchestrationMetadata object that contains metadata about the started instance. |
Extension Methods
PurgeInstancesAsync(DurableTaskClient, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, IEnumerable<OrchestrationRuntimeStatus>, CancellationToken) |
Purges orchestration instances metadata from the durable store. |
PurgeInstancesAsync(DurableTaskClient, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, CancellationToken) |
Purges orchestration instances metadata from the durable store. |