Skip to main content

Class: RetryPolicy

How retries ought to be handled, usable by both workflows and activities

Properties​

backoffCoefficient​

backoffCoefficient: number

Coefficient used to calculate the next retry interval. The next retry interval is previous interval multiplied by the coefficient. Must be 1 or larger.


initialInterval?​

optional initialInterval?: $Properties | null

Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries.


maximumAttempts​

maximumAttempts: number

Maximum number of attempts. When exceeded the retries stop even if not expired yet. 1 disables retries. 0 means unlimited (up to the timeouts)


maximumInterval?​

optional maximumInterval?: $Properties | null

Maximum interval between retries. Exponential backoff leads to interval increase. This value is the cap of the increase. Default is 100x of the initial interval.


nonRetryableErrorTypes​

nonRetryableErrorTypes: string[]

Non-Retryable errors types. Will stop retrying if the error type matches this list. Note that this is not a substring match, the error type (not message) must match exactly.

Methods​

toJSON()​

toJSON(): object

Converts this RetryPolicy to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): RetryPolicy & $Properties

Creates a new RetryPolicy instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

RetryPolicy & $Properties

RetryPolicy instance

Call Signature​

static create(properties?): RetryPolicy

Creates a new RetryPolicy instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

RetryPolicy

RetryPolicy instance


decode()​

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

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

RetryPolicy & $Properties

RetryPolicy

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): RetryPolicy & $Properties

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

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

Returns​

RetryPolicy & $Properties

RetryPolicy

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

Parameters​

message​

$Properties

RetryPolicy message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

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

Parameters​

message​

$Properties

RetryPolicy message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): RetryPolicy

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

Parameters​

object​

{[k: string]: any; }

Plain object

Returns​

RetryPolicy

RetryPolicy


toObject()​

static toObject(message, options?): object

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

Parameters​

message​

RetryPolicy

RetryPolicy

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object