Skip to main content

Class: WorkerSelector

This is used to send commands to a specific worker or a group of workers. Right now, it is used to send commands to a specific worker instance. Will be extended to be able to send command to multiple workers.

Properties​

selector?​

optional selector?: "workerInstanceKey"

Options are:

  • query (will be used as query to ListWorkers, same format as in ListWorkersRequest.query)
  • task queue (just a shortcut. Same as query=' "TaskQueue"="my-task-queue" ')
  • etc. All but 'query' are shortcuts, can be replaced with a query, but it is not convenient. string query = 5; string task_queue = 6; ...

workerInstanceKey?​

optional workerInstanceKey?: string | null

Worker instance key to which the command should be sent.

Methods​

toJSON()​

toJSON(): object

Converts this WorkerSelector to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): WorkerSelector & $Shape

Creates a new WorkerSelector instance using the specified properties.

Parameters​
properties?​

$Shape

Properties to set

Returns​

WorkerSelector & $Shape

WorkerSelector instance

Call Signature​

static create(properties?): WorkerSelector

Creates a new WorkerSelector instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

WorkerSelector

WorkerSelector instance


decode()​

static decode(reader, length?): WorkerSelector & $Shape

Decodes a WorkerSelector message from the specified reader or buffer.

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

length?​

number

Message length if known beforehand

Returns​

WorkerSelector & $Shape

WorkerSelector

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): WorkerSelector & $Shape

Decodes a WorkerSelector message from the specified reader or buffer, length delimited.

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

Returns​

WorkerSelector & $Shape

WorkerSelector

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


encode()​

static encode(message, writer?): Writer

Encodes the specified WorkerSelector message. Does not implicitly temporal.api.common.v1.WorkerSelector.verify|verify messages.

Parameters​

message​

$Properties

WorkerSelector message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

Encodes the specified WorkerSelector message, length delimited. Does not implicitly temporal.api.common.v1.WorkerSelector.verify|verify messages.

Parameters​

message​

$Properties

WorkerSelector message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): WorkerSelector

Creates a WorkerSelector message from a plain object. Also converts values to their respective internal types.

Parameters​

object​

{[k: string]: any; }

Plain object

Returns​

WorkerSelector

WorkerSelector


toObject()​

static toObject(message, options?): object

Creates a plain object from a WorkerSelector message. Also converts values to other types if specified.

Parameters​

message​

WorkerSelector

WorkerSelector

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object