Table of Contents

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

Client ITemporalClient

Client used for async activity handle calls.

Activity AsyncActivityHandle.Reference

Reference to the activity for this handle.

Properties

Activity

Reference to the activity for this handle.

public AsyncActivityHandle.Reference Activity { get; init; }

Property Value

AsyncActivityHandle.Reference

Client

Client used for async activity handle calls.

public ITemporalClient Client { get; init; }

Property Value

ITemporalClient

DataConverterOverride

Gets or inits the data converter that will be used instead of the clients if set.

public DataConverter? DataConverterOverride { get; init; }

Property Value

DataConverter

Methods

CompleteAsync(object?, AsyncActivityCompleteOptions?)

Complete this activity.

public Task CompleteAsync(object? result = null, AsyncActivityCompleteOptions? options = null)

Parameters

result object

Result of the activity.

options AsyncActivityCompleteOptions

Completion options.

Returns

Task

Completion task.

FailAsync(Exception, AsyncActivityFailOptions?)

Fail this activity.

public Task FailAsync(Exception exception, AsyncActivityFailOptions? options = null)

Parameters

exception Exception

Exception for the activity.

options AsyncActivityFailOptions

Fail options.

Returns

Task

Completion task.

HeartbeatAsync(AsyncActivityHeartbeatOptions?)

Issue a heartbeat for this activity.

public Task HeartbeatAsync(AsyncActivityHeartbeatOptions? options = null)

Parameters

options AsyncActivityHeartbeatOptions

Heartbeat 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

options AsyncActivityReportCancellationOptions

Cancel 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

context ISerializationContext

Context to provide to data converter.

Returns

AsyncActivityHandle

New handle if context supported on data converter, same handle otherwise.