Skip to main content

Class: ComputeScaler

ComputeScaler instructs the Temporal Service when to scale up or down the number of Workers that comprise a WorkerDeployment.

Properties​

details?​

optional details?: $Properties | null

Contains scaler-specific instructions and configuration. For server-implemented scalers, use the SDK's default data converter to ensure the server can understand it. For remote-implemented scalers, you might use your own data converters according to what the remote endpoints understand.


type​

type: string

Type of the compute scaler. this string is implementation-specific and can be used by implementations to understand how to interpret the contents of the scaler_details field.

Methods​

toJSON()​

toJSON(): object

Converts this ComputeScaler to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): ComputeScaler & $Properties

Creates a new ComputeScaler instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

ComputeScaler & $Properties

ComputeScaler instance

Call Signature​

static create(properties?): ComputeScaler

Creates a new ComputeScaler instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

ComputeScaler

ComputeScaler instance


decode()​

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

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

ComputeScaler & $Properties

ComputeScaler

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): ComputeScaler & $Properties

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

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

Returns​

ComputeScaler & $Properties

ComputeScaler

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

Parameters​

message​

$Properties

ComputeScaler message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

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

Parameters​

message​

$Properties

ComputeScaler message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): ComputeScaler

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

Parameters​

object​

Plain object

Returns​

ComputeScaler

ComputeScaler


toObject()​

static toObject(message, options?): object

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

Parameters​

message​

ComputeScaler

ComputeScaler

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object