Skip to main content

Class: WorkerSelector

common.v1.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: null | string

Worker instance key to which the command should be sent.

Methods​

toJSON​

▸ toJSON(): Object

Converts this WorkerSelector to JSON.

Returns​

Object

JSON object


create​

▸ create(properties?): WorkerSelector & $Shape

Creates a new WorkerSelector instance using the specified properties.

Parameters​

NameTypeDescription
properties?$ShapeProperties to set

Returns​

WorkerSelector & $Shape

WorkerSelector instance

▸ create(properties?): WorkerSelector

Parameters​

NameType
properties?$Properties

Returns​

WorkerSelector


decode​

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

Decodes a WorkerSelector message from the specified reader or buffer.

Parameters​

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage 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​

▸ decodeDelimited(reader): WorkerSelector & $Shape

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

Parameters​

NameTypeDescription
readerUint8Array | ReaderReader 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​

▸ encode(message, writer?): Writer

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

Parameters​

NameTypeDescription
message$PropertiesWorkerSelector message or plain object to encode
writer?WriterWriter to encode to

Returns​

Writer

Writer


encodeDelimited​

▸ encodeDelimited(message, writer?): Writer

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

Parameters​

NameTypeDescription
message$PropertiesWorkerSelector message or plain object to encode
writer?WriterWriter to encode to

Returns​

Writer

Writer


fromObject​

▸ fromObject(object): WorkerSelector

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

Parameters​

NameTypeDescription
objectObjectPlain object

Returns​

WorkerSelector

WorkerSelector


toObject​

▸ toObject(message, options?): Object

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

Parameters​

NameTypeDescription
messageWorkerSelectorWorkerSelector
options?IConversionOptionsConversion options

Returns​

Object

Plain object