Class: WorkerHostInfo
Holds everything needed to identify the worker host/process context
Implements
Constructors
constructor
• new WorkerHostInfo(properties?): WorkerHostInfo
Constructs a new WorkerHostInfo.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | IWorkerHostInfo | Properties to set |
Returns
Properties
currentHostCpuUsage
• currentHostCpuUsage: number
System used CPU as a float in the range [0.0, 1.0] where 1.0 is defined as all cores on the host pegged.
Implementation of
IWorkerHostInfo.currentHostCpuUsage
currentHostMemUsage
• currentHostMemUsage: number
System used memory as a float in the range [0.0, 1.0] where 1.0 is defined as all available memory on the host is used.
Implementation of
IWorkerHostInfo.currentHostMemUsage
hostName
• hostName: string
Worker host identifier.
Implementation of
processId
• processId: string
Worker process identifier. This id only needs to be unique within one host (so using e.g. a unix pid would be appropriate).
Implementation of
workerGroupingKey
• workerGroupingKey: string
Worker grouping identifier. A key to group workers that share the same client+namespace+process. This will be used to build the worker command nexus task queue name: "temporal-sys/worker-commands/{worker_grouping_key}"
Implementation of
IWorkerHostInfo.workerGroupingKey
Methods
toJSON
▸ toJSON(): Object
Converts this WorkerHostInfo to JSON.
Returns
Object
JSON object
create
▸ create(properties?): WorkerHostInfo
Creates a new WorkerHostInfo instance using the specified properties.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | IWorkerHostInfo | Properties to set |
Returns
WorkerHostInfo instance
decode
▸ decode(reader, length?): WorkerHostInfo
Decodes a WorkerHostInfo 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
WorkerHostInfo
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited
▸ decodeDelimited(reader): WorkerHostInfo
Decodes a WorkerHostInfo message from the specified reader or buffer, length delimited.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
WorkerHostInfo
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 WorkerHostInfo message. Does not implicitly temporal.api.worker.v1.WorkerHostInfo.verify|verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | IWorkerHostInfo | WorkerHostInfo message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
encodeDelimited
▸ encodeDelimited(message, writer?): Writer
Encodes the specified WorkerHostInfo message, length delimited. Does not implicitly temporal.api.worker.v1.WorkerHostInfo.verify|verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | IWorkerHostInfo | WorkerHostInfo message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
fromObject
▸ fromObject(object): WorkerHostInfo
Creates a WorkerHostInfo message from a plain object. Also converts values to their respective internal types.
Parameters
| Name | Type | Description |
|---|---|---|
object | Object | Plain object |
Returns
WorkerHostInfo
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?): string
Gets the default type url for WorkerHostInfo
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 WorkerHostInfo message. Also converts values to other types if specified.
Parameters
| Name | Type | Description |
|---|---|---|
message | WorkerHostInfo | WorkerHostInfo |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object