Class: AsyncCompletionClient
A client for asynchronous completion and heartbeating of Activities.
Typically this client should not be instantiated directly, instead create the high level Client and use Client.activity to complete async activities.
Extends
BaseClient
Extended by
Constructors
Constructor
new AsyncCompletionClient(
options?):AsyncCompletionClient
Parameters
options?
BaseClientOptions
Returns
AsyncCompletionClient
Overrides
BaseClient.constructor
Properties
connection
readonlyconnection:ConnectionLike
The underlying connection or NativeConnection | native connection used by this client.
Clients are cheap to create, but connections are expensive. Where it makes sense,
a single connection may and should be reused by multiple Clients.
Inherited from
BaseClient.connection
options
readonlyoptions:LoadedAsyncCompletionClientOptions
Accessors
workflowService
Get Signature
get workflowService():
WorkflowService
Raw gRPC access to the Temporal service.
NOTE: The namespace provided in options is not automatically set on requests made via this service object.
Returns
Methods
complete()
Call Signature
complete(
taskToken,result,options?):Promise<void>
Complete an Activity by task token
Parameters
taskToken
Uint8Array
result
unknown
options?
AsyncCompletionCompleteOptions & AsyncCompletionOperationOptions
Returns
Promise<void>
Call Signature
complete(
fullActivityId,result,options?):Promise<void>
Complete an Activity by full ID
Parameters
fullActivityId
result
unknown
options?
AsyncCompletionCompleteOptions
Returns
Promise<void>
fail()
Call Signature
fail(
taskToken,err,options?):Promise<void>
Fail an Activity by task token
Parameters
taskToken
Uint8Array
err
unknown
options?
AsyncCompletionOperationOptions
Returns
Promise<void>
Call Signature
fail(
fullActivityId,err):Promise<void>
Fail an Activity by full ID
Parameters
fullActivityId
err
unknown
Returns
Promise<void>
heartbeat()
Call Signature
heartbeat(
taskToken,details?,options?):Promise<void>
Send Activity heartbeat by task token
Parameters
taskToken
Uint8Array
details?
unknown
options?
AsyncCompletionOperationOptions
Returns
Promise<void>
Call Signature
heartbeat(
fullActivityId,details?):Promise<void>
Send Activity heartbeat by full ID
Parameters
fullActivityId
details?
unknown
Returns
Promise<void>
reportCancellation()
Call Signature
reportCancellation(
taskToken,details?,options?):Promise<void>
Report Activity cancellation by task token
Parameters
taskToken
Uint8Array
details?
unknown
options?
AsyncCompletionOperationOptions
Returns
Promise<void>
Call Signature
reportCancellation(
fullActivityId,details?):Promise<void>
Report Activity cancellation by full ID
Parameters
fullActivityId
details?
unknown
Returns
Promise<void>
withAbortSignal()
withAbortSignal<
R>(abortSignal,fn):Promise<R>
Set an AbortSignal that, when aborted, cancels any ongoing service requests executed in
fn's scope. This will locally result in the request call throwing a _grpc.ServiceError|ServiceError
with code _grpc.status.CANCELLED|CANCELLED; see isGrpcCancelledError.
This method is only a convenience wrapper around Connection.withAbortSignal.
Type Parameters
R
R
Parameters
abortSignal
AbortSignal
fn
() => Promise<R>
Returns
Promise<R>
value returned from fn
See
https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
Inherited from
BaseClient.withAbortSignal
withDeadline()
withDeadline<
R>(deadline,fn):Promise<R>
Set a deadline for any service requests executed in fn's scope.
The deadline is a point in time after which any pending gRPC request will be considered as failed; this will locally result in the request call throwing a _grpc.ServiceError|ServiceError with code _grpc.status.DEADLINE_EXCEEDED|DEADLINE_EXCEEDED; see isGrpcDeadlineError.
It is stronly recommended to explicitly set deadlines. If no deadline is set, then it is possible for the client to end up waiting forever for a response.
This method is only a convenience wrapper around Connection.withDeadline.
Type Parameters
R
R
Parameters
deadline
number | Date
a point in time after which the request will be considered as failed; either a Date object, or a number of milliseconds since the Unix epoch (UTC).
fn
() => Promise<R>
Returns
Promise<R>
the value returned from fn
See
https://grpc.io/docs/guides/deadlines/
Inherited from
BaseClient.withDeadline
withMetadata()
withMetadata<
R>(metadata,fn):Promise<R>
Set metadata for any service requests executed in fn's scope.
This method is only a convenience wrapper around Connection.withMetadata.
Type Parameters
R
R
Parameters
metadata
fn
() => Promise<R>
Returns
Promise<R>
returned value of fn
Inherited from
BaseClient.withMetadata