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.
Implements
Constructors
constructor
• new WorkerSelector(properties?
): WorkerSelector
Constructs a new WorkerSelector.
Parameters
Name | Type | Description |
---|---|---|
properties? | IWorkerSelector | Properties to set |
Returns
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
Name | Type | Description |
---|---|---|
properties? | IWorkerSelector | Properties to set |
Returns
WorkerSelector instance
decode
▸ decode(reader
, length?
): WorkerSelector
Decodes a WorkerSelector message from the specified reader or buffer.
Parameters
Name | Type | Description |
---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
length? | number | Message length if known beforehand |
Returns
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
Name | Type | Description |
---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
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
Name | Type | Description |
---|---|---|
message | IWorkerSelector | WorkerSelector message or plain object to encode |
writer? | Writer | Writer 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
Name | Type | Description |
---|---|---|
message | IWorkerSelector | WorkerSelector message or plain object to encode |
writer? | Writer | Writer 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
Name | Type | Description |
---|---|---|
object | Object | Plain object |
Returns
WorkerSelector
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?
): string
Gets the default type url for WorkerSelector
Parameters
Name | Type | Description |
---|---|---|
typeUrlPrefix? | string | your 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
Name | Type | Description |
---|---|---|
message | WorkerSelector | WorkerSelector |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object