Skip to main content

Class: WorkerHostInfo

worker.v1.WorkerHostInfo

Holds everything needed to identify the worker host/process context

Implements

Constructors

constructor

new WorkerHostInfo(properties?): WorkerHostInfo

Constructs a new WorkerHostInfo.

Parameters

NameTypeDescription
properties?IWorkerHostInfoProperties to set

Returns

WorkerHostInfo

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

IWorkerHostInfo.hostName


processId

processId: string

Worker process identifier. Unlike process_key, this id only needs to be unique within one host (so using e.g. a unix pid would be appropriate).

Implementation of

IWorkerHostInfo.processId


processKey

processKey: string

Worker process identifier. This id should be unique for all processes running workers in the namespace, and should be shared by all workers in the same process. This will be used to build the worker command nexus task queue name: "temporal-sys/worker-commands/{process_key}"

Implementation of

IWorkerHostInfo.processKey

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

NameTypeDescription
properties?IWorkerHostInfoProperties to set

Returns

WorkerHostInfo

WorkerHostInfo instance


decode

decode(reader, length?): WorkerHostInfo

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

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

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

WorkerHostInfo

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


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for WorkerHostInfo

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 WorkerHostInfo message. Also converts values to other types if specified.

Parameters

NameTypeDescription
messageWorkerHostInfoWorkerHostInfo
options?IConversionOptionsConversion options

Returns

Object

Plain object