Skip to main content

Class: RetryPolicy

common.v1.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: null | $Properties

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: null | $Properties

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

create(properties?): RetryPolicy & $Properties

Creates a new RetryPolicy instance using the specified properties.

Parameters

NameTypeDescription
properties?$PropertiesProperties to set

Returns

RetryPolicy & $Properties

RetryPolicy instance

create(properties?): RetryPolicy

Parameters

NameType
properties?$Properties

Returns

RetryPolicy


decode

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

Decodes a RetryPolicy message from the specified reader or buffer.

Parameters

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

decodeDelimited(reader): RetryPolicy & $Properties

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

Parameters

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

encode(message, writer?): Writer

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

Parameters

NameTypeDescription
message$PropertiesRetryPolicy message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

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

Parameters

NameTypeDescription
message$PropertiesRetryPolicy message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


fromObject

fromObject(object): RetryPolicy

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

Parameters

NameTypeDescription
objectObjectPlain object

Returns

RetryPolicy

RetryPolicy


toObject

toObject(message, options?): Object

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

Parameters

NameTypeDescription
messageRetryPolicyRetryPolicy
options?IConversionOptionsConversion options

Returns

Object

Plain object