Class: 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
Name | Type | Description |
---|---|---|
properties? | IRetryPolicy | Properties to set |
Returns
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
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
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
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
Name | Type | Description |
---|---|---|
properties? | IRetryPolicy | Properties to set |
Returns
RetryPolicy instance
decode
▸ decode(reader
, length?
): RetryPolicy
Decodes a RetryPolicy message from the specified reader or buffer.
Parameters
Name | Type | Description |
---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
length? | number | Message length if known beforehand |
Returns
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
Name | Type | Description |
---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
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
Name | Type | Description |
---|---|---|
message | IRetryPolicy | RetryPolicy message or plain object to encode |
writer? | Writer | Writer 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
Name | Type | Description |
---|---|---|
message | IRetryPolicy | RetryPolicy message or plain object to encode |
writer? | Writer | Writer 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
Name | Type | Description |
---|---|---|
object | Object | Plain object |
Returns
RetryPolicy
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?
): string
Gets the default type url for RetryPolicy
Parameters
Name | Type | Description |
---|---|---|
typeUrlPrefix? | string | your 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
Name | Type | Description |
---|---|---|
message | RetryPolicy | RetryPolicy |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object