Skip to main content

Class: RetryPolicy

common.v1.RetryPolicy

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

Implements

Constructors

constructor

new RetryPolicy(properties?): RetryPolicy

Constructs a new RetryPolicy.

Parameters

NameTypeDescription
properties?IRetryPolicyProperties to set

Returns

RetryPolicy

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.

Implementation of

IRetryPolicy.backoffCoefficient


initialInterval

Optional initialInterval: null | IDuration

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

Implementation of

IRetryPolicy.initialInterval


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)

Implementation of

IRetryPolicy.maximumAttempts


maximumInterval

Optional maximumInterval: null | IDuration

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.

Implementation of

IRetryPolicy.maximumInterval


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.

Implementation of

IRetryPolicy.nonRetryableErrorTypes

Methods

toJSON

toJSON(): Object

Converts this RetryPolicy to JSON.

Returns

Object

JSON object


create

create(properties?): RetryPolicy

Creates a new RetryPolicy instance using the specified properties.

Parameters

NameTypeDescription
properties?IRetryPolicyProperties to set

Returns

RetryPolicy

RetryPolicy instance


decode

decode(reader, length?): RetryPolicy

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

RetryPolicy

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): RetryPolicy

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

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

RetryPolicy

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


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for RetryPolicy

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

Parameters

NameTypeDescription
messageRetryPolicyRetryPolicy
options?IConversionOptionsConversion options

Returns

Object

Plain object