Class: TaskQueueClient
client.TaskQueueClient
Client for starting Workflow executions and creating Workflow handles
Hierarchy
-
BaseClient
↳
TaskQueueClient
Constructors
constructor
• new TaskQueueClient(options?
): TaskQueueClient
Parameters
Name | Type |
---|---|
options? | BaseClientOptions |
Returns
Overrides
BaseClient.constructor
Properties
connection
• Readonly
connection: ConnectionLike
The underlying 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 Client
s.
Inherited from
BaseClient.connection
options
• Readonly
options: LoadedTaskQueueClientOptions
Accessors
workflowService
• get
workflowService(): WorkflowService
Raw gRPC access to the Temporal service.
NOTE: The namespace provided in options is not automatically set on requests using this service attribute.
Returns
Methods
getBuildIdCompatability
▸ getBuildIdCompatability(taskQueue
): Promise
<undefined
| WorkerBuildIdVersionSets
>
Fetch the sets of compatible Build Ids for a given task queue.
Parameters
Name | Type | Description |
---|---|---|
taskQueue | string | The task queue to fetch the compatibility information for. |
Returns
Promise
<undefined
| WorkerBuildIdVersionSets
>
The sets of compatible Build Ids for the given task queue, or undefined if the queue has no Build Ids defined on it.
getReachability
▸ getReachability(options
): Promise
<ReachabilityResponse
>
Fetches task reachability to determine whether a worker may be retired. The request may specify task queues to query for or let the server fetch all task queues mapped to the given build IDs.
When requesting a large number of task queues or all task queues associated with the given
build ids in a namespace, all task queues will be listed in the response but some of them may
not contain reachability information due to a server enforced limit. When reaching the limit,
task queues that reachability information could not be retrieved for will be marked with a
NotFetched
entry in BuildIdReachability.taskQueueReachability. The caller may issue
another call to get the reachability for those task queues.
Parameters
Name | Type |
---|---|
options | ReachabilityOptions |
Returns
Promise
<ReachabilityResponse
>
updateBuildIdCompatibility
▸ updateBuildIdCompatibility(taskQueue
, operation
): Promise
<void
>
Used to add new Build Ids or otherwise update the relative compatibility of Build Ids as defined on a specific task queue for the Worker Versioning feature. For more on this feature, see https://docs.temporal.io/workers#worker-versioning
Parameters
Name | Type | Description |
---|---|---|
taskQueue | string | The task queue to make changes to. |
operation | BuildIdOperation | The operation to be performed. |
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
Name |
---|
R |
Parameters
Name | Type |
---|---|
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
Name |
---|
R |
Parameters
Name | Type | Description |
---|---|---|
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
Name |
---|
R |
Parameters
Name | Type |
---|---|
metadata | Metadata |
fn | () => Promise <R > |
Returns
Promise
<R
>
returned value of fn
Inherited from
BaseClient.withMetadata