Skip to main content

Class: WorkerHostInfo

Holds everything needed to identify the worker host/process context

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.


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.


hostName​

hostName: string

Worker host identifier.


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).


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}"

Methods​

toJSON()​

toJSON(): object

Converts this WorkerHostInfo to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): WorkerHostInfo & $Properties

Creates a new WorkerHostInfo instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

WorkerHostInfo & $Properties

WorkerHostInfo instance

Call Signature​

static create(properties?): WorkerHostInfo

Creates a new WorkerHostInfo instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

WorkerHostInfo

WorkerHostInfo instance


decode()​

static decode(reader, length?): WorkerHostInfo & $Properties

Decodes a WorkerHostInfo 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​

WorkerHostInfo & $Properties

WorkerHostInfo

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): WorkerHostInfo & $Properties

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

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

Returns​

WorkerHostInfo & $Properties

WorkerHostInfo

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 WorkerHostInfo message. Does not implicitly temporal.api.worker.v1.WorkerHostInfo.verify|verify messages.

Parameters​

message​

$Properties

WorkerHostInfo message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

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

Parameters​

message​

$Properties

WorkerHostInfo message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): WorkerHostInfo

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

Parameters​

object​

Plain object

Returns​

WorkerHostInfo

WorkerHostInfo


toObject()​

static toObject(message, options?): object

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

Parameters​

message​

WorkerHostInfo

WorkerHostInfo

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object