Skip to main content

Class: TaskQueueClient

Client for starting Workflow executions and creating Workflow handles

Deprecated​

Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments

Extends​

  • BaseClient

Constructors​

Constructor​

new TaskQueueClient(options?): TaskQueueClient

Parameters​

options?​

BaseClientOptions

Returns​

TaskQueueClient

Overrides​

BaseClient.constructor

Properties​

connection​

readonly connection: 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​

readonly options: LoadedTaskQueueClientOptions

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 using this service attribute.

Returns​

WorkflowService

Methods​

getBuildIdCompatability()​

getBuildIdCompatability(taskQueue): Promise<WorkerBuildIdVersionSets | undefined>

Fetch the sets of compatible Build Ids for a given task queue.

Parameters​

taskQueue​

string

The task queue to fetch the compatibility information for.

Returns​

Promise<WorkerBuildIdVersionSets | undefined>

The sets of compatible Build Ids for the given task queue, or undefined if the queue has no Build Ids defined on it.

Deprecated​

Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments


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​

options​

ReachabilityOptions

Returns​

Promise<ReachabilityResponse>

Deprecated​

Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments


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​

taskQueue​

string

The task queue to make changes to.

operation​

BuildIdOperation

The operation to be performed.

Returns​

Promise<void>

Deprecated​

Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments


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​

Metadata

fn​

() => Promise<R>

Returns​

Promise<R>

returned value of fn

Inherited from​

BaseClient.withMetadata