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.

Implements

Constructors

constructor

new WorkerSelector(properties?): WorkerSelector

Constructs a new WorkerSelector.

Parameters

NameTypeDescription
properties?IWorkerSelectorProperties to set

Returns

WorkerSelector

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.

Implementation of

IWorkerSelector.workerInstanceKey

Methods

toJSON

toJSON(): Object

Converts this WorkerSelector to JSON.

Returns

Object

JSON object


create

create(properties?): WorkerSelector

Creates a new WorkerSelector instance using the specified properties.

Parameters

NameTypeDescription
properties?IWorkerSelectorProperties to set

Returns

WorkerSelector

WorkerSelector instance


decode

decode(reader, length?): WorkerSelector

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

WorkerSelector

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): WorkerSelector

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

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

WorkerSelector

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
messageIWorkerSelectorWorkerSelector 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
messageIWorkerSelectorWorkerSelector 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


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for WorkerSelector

Parameters

NameTypeDescription
typeUrlPrefix?stringyour custom typeUrlPrefix(default "type.googleapis.com")

Returns

string

The default type url


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