Skip to main content

Class: WorkerHostInfo

worker.v1.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

create(properties?): WorkerHostInfo & $Properties

Creates a new WorkerHostInfo instance using the specified properties.

Parameters

NameTypeDescription
properties?$PropertiesProperties to set

Returns

WorkerHostInfo & $Properties

WorkerHostInfo instance

create(properties?): WorkerHostInfo

Parameters

NameType
properties?$Properties

Returns

WorkerHostInfo


decode

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

Decodes a WorkerHostInfo message from the specified reader or buffer.

Parameters

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

decodeDelimited(reader): WorkerHostInfo & $Properties

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

Parameters

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

encode(message, writer?): Writer

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

Parameters

NameTypeDescription
message$PropertiesWorkerHostInfo message or plain object to encode
writer?WriterWriter 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

NameTypeDescription
message$PropertiesWorkerHostInfo message or plain object to encode
writer?WriterWriter 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

NameTypeDescription
objectObjectPlain object

Returns

WorkerHostInfo

WorkerHostInfo


toObject

toObject(message, options?): Object

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

Parameters

NameTypeDescription
messageWorkerHostInfoWorkerHostInfo
options?IConversionOptionsConversion options

Returns

Object

Plain object