Class AsyncActivityHandle
- Namespace
- Temporalio.Client
- Assembly
- Temporalio.dll
Handle to perform activity actions for activities that will complete asynchronously.
public record AsyncActivityHandle : IWithSerializationContext<AsyncActivityHandle>, IEquatable<AsyncActivityHandle>
- Inheritance
-
AsyncActivityHandle
- Implements
- Inherited Members
Constructors
AsyncActivityHandle(ITemporalClient, Reference)
Handle to perform activity actions for activities that will complete asynchronously.
public AsyncActivityHandle(ITemporalClient Client, AsyncActivityHandle.Reference Activity)
Parameters
ClientITemporalClientClient used for async activity handle calls.
ActivityAsyncActivityHandle.ReferenceReference to the activity for this handle.
Properties
Activity
Reference to the activity for this handle.
public AsyncActivityHandle.Reference Activity { get; init; }
Property Value
Client
Client used for async activity handle calls.
public ITemporalClient Client { get; init; }
Property Value
DataConverterOverride
Gets or inits the data converter that will be used instead of the clients if set.
public DataConverter? DataConverterOverride { get; init; }
Property Value
Methods
CompleteAsync(object?, AsyncActivityCompleteOptions?)
Complete this activity.
public Task CompleteAsync(object? result = null, AsyncActivityCompleteOptions? options = null)
Parameters
resultobjectResult of the activity.
optionsAsyncActivityCompleteOptionsCompletion options.
Returns
- Task
Completion task.
FailAsync(Exception, AsyncActivityFailOptions?)
Fail this activity.
public Task FailAsync(Exception exception, AsyncActivityFailOptions? options = null)
Parameters
exceptionExceptionException for the activity.
optionsAsyncActivityFailOptionsFail options.
Returns
- Task
Completion task.
HeartbeatAsync(AsyncActivityHeartbeatOptions?)
Issue a heartbeat for this activity.
public Task HeartbeatAsync(AsyncActivityHeartbeatOptions? options = null)
Parameters
optionsAsyncActivityHeartbeatOptionsHeartbeat options.
Returns
- Task
Completion task.
Exceptions
- AsyncActivityCanceledException
If the server has requested that this activity be cancelled. Users should catch this and invoke ReportCancellationAsync(AsyncActivityReportCancellationOptions?) for proper behavior.
ReportCancellationAsync(AsyncActivityReportCancellationOptions?)
Report this activity as cancelled.
public Task ReportCancellationAsync(AsyncActivityReportCancellationOptions? options = null)
Parameters
optionsAsyncActivityReportCancellationOptionsCancel options.
Returns
- Task
Completion task.
WithSerializationContext(ISerializationContext)
If the data converter supports customizing based on serialization context, recreate this handle with a data converter override using the given context.
public AsyncActivityHandle WithSerializationContext(ISerializationContext context)
Parameters
contextISerializationContextContext to provide to data converter.
Returns
- AsyncActivityHandle
New handle if context supported on data converter, same handle otherwise.