Documentation

RpcRetryOptions extends RetryOptions
in package

FinalYes

Note that the history of activity with retry policy will be different:

Tags
psalm-import-type

DateIntervalValue from DateInterval

psalm-immutable

Table of Contents

Constants

DEFAULT_BACKOFF_COEFFICIENT  = 2.0
DEFAULT_INITIAL_INTERVAL  = null
DEFAULT_MAXIMUM_ATTEMPTS  = 0
DEFAULT_MAXIMUM_INTERVAL  = null
DEFAULT_NON_RETRYABLE_EXCEPTIONS  = []

Properties

$backoffCoefficient  : float
Coefficient used to calculate the next retry backoff interval. The next retry interval is previous interval multiplied by this coefficient.
$congestionInitialInterval  : DateInterval|null
Interval of the first retry, on congestion related failures (i.e. RESOURCE_EXHAUSTED errors).
$initialInterval  : DateInterval|null
Backoff interval for the first retry. If {@see RetryOptions::$backoffCoefficient} is 1.0 then it is used for all retries.
$maximumAttempts  : int<0, max>
Maximum number of attempts. When exceeded the retries stop even if not expired yet. If not set or set to 0, it means unlimited, and rely on activity {@see ActivityOptions::$scheduleToCloseTimeout} to stop.
$maximumInterval  : DateInterval|null
Maximum backoff interval between retries. Exponential backoff leads to interval increase. This value is the cap of the interval.
$maximumJitterCoefficient  : float
Maximum amount of jitter to apply.
$nonRetryableExceptions  : ExceptionsList
Non-Retriable errors. This is optional. Temporal server will stop retry if error type matches this list.

Methods

mergeWith()  : self
toWorkflowRetryPolicy()  : RetryPolicy
Converts DTO to protobuf object
withBackoffCoefficient()  : static
withCongestionInitialInterval()  : self
Interval of the first retry, on congestion related failures (i.e. RESOURCE_EXHAUSTED errors).
withInitialInterval()  : static
withMaximumAttempts()  : static
withMaximumInterval()  : static
withMaximumJitterCoefficient()  : self
Maximum amount of jitter to apply.
withNonRetryableExceptions()  : static

Constants

DEFAULT_BACKOFF_COEFFICIENT

public float DEFAULT_BACKOFF_COEFFICIENT = 2.0

DEFAULT_INITIAL_INTERVAL

public null DEFAULT_INITIAL_INTERVAL = null

DEFAULT_MAXIMUM_ATTEMPTS

public int<0, max> DEFAULT_MAXIMUM_ATTEMPTS = 0

DEFAULT_MAXIMUM_INTERVAL

public null DEFAULT_MAXIMUM_INTERVAL = null

DEFAULT_NON_RETRYABLE_EXCEPTIONS

public mixed DEFAULT_NON_RETRYABLE_EXCEPTIONS = []
Tags
psalm-var

ExceptionsList

Properties

$backoffCoefficient

Coefficient used to calculate the next retry backoff interval. The next retry interval is previous interval multiplied by this coefficient.

public float $backoffCoefficient = self::DEFAULT_BACKOFF_COEFFICIENT

Note: Must be greater than 1.0

$congestionInitialInterval

Interval of the first retry, on congestion related failures (i.e. RESOURCE_EXHAUSTED errors).

public DateInterval|null $congestionInitialInterval = null

If coefficient is 1.0 then it is used for all retries. Defaults to 1000ms.

$initialInterval

Backoff interval for the first retry. If {@see RetryOptions::$backoffCoefficient} is 1.0 then it is used for all retries.

public DateInterval|null $initialInterval = self::DEFAULT_INITIAL_INTERVAL

$maximumAttempts

Maximum number of attempts. When exceeded the retries stop even if not expired yet. If not set or set to 0, it means unlimited, and rely on activity {@see ActivityOptions::$scheduleToCloseTimeout} to stop.

public int<0, max> $maximumAttempts = self::DEFAULT_MAXIMUM_ATTEMPTS

$maximumInterval

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

public DateInterval|null $maximumInterval = self::DEFAULT_MAXIMUM_INTERVAL

Default is 100x of $initialInterval.

$maximumJitterCoefficient

Maximum amount of jitter to apply.

public float $maximumJitterCoefficient = 0.1

Must be lower than 1.

0.1 means that actual retry time can be +/- 10% of the calculated time.

$nonRetryableExceptions

Non-Retriable errors. This is optional. Temporal server will stop retry if error type matches this list.

public ExceptionsList $nonRetryableExceptions = self::DEFAULT_NON_RETRYABLE_EXCEPTIONS

Methods

toWorkflowRetryPolicy()

Converts DTO to protobuf object

public toWorkflowRetryPolicy() : RetryPolicy
Tags
psalm-suppress

ImpureMethodCall

Return values
RetryPolicy

withBackoffCoefficient()

public withBackoffCoefficient(float $coefficient) : static
Parameters
$coefficient : float
Tags
psalm-suppress

ImpureMethodCall

Return values
static

withCongestionInitialInterval()

Interval of the first retry, on congestion related failures (i.e. RESOURCE_EXHAUSTED errors).

public withCongestionInitialInterval(DateIntervalValue|null $interval) : self

If coefficient is 1.0 then it is used for all retries. Defaults to 1000ms.

Parameters
$interval : DateIntervalValue|null

Interval to wait on first retry, on congestion failures. Defaults to 1000ms, which is used if set to null.

Tags
psalm-suppress

ImpureMethodCall

Return values
self

withInitialInterval()

public withInitialInterval(DateIntervalValue|null $interval) : static
Parameters
$interval : DateIntervalValue|null
Tags
psalm-suppress

ImpureMethodCall

Return values
static

withMaximumAttempts()

public withMaximumAttempts(int<0, max> $attempts) : static
Parameters
$attempts : int<0, max>
Tags
psalm-suppress

ImpureMethodCall

Return values
static

withMaximumInterval()

public withMaximumInterval(DateIntervalValue|null $interval) : static
Parameters
$interval : DateIntervalValue|null
Tags
psalm-suppress

ImpureMethodCall

Return values
static

withMaximumJitterCoefficient()

Maximum amount of jitter to apply.

public withMaximumJitterCoefficient(null|float $coefficient) : self

0.2 means that actual retry time can be +/- 20% of the calculated time. Set to 0 to disable jitter. Must be lower than 1.

Parameters
$coefficient : null|float

Maximum amount of jitter. Default will be used if set to null.

Return values
self

withNonRetryableExceptions()

public withNonRetryableExceptions(ExceptionsList $exceptions) : static
Parameters
$exceptions : ExceptionsList
Tags
psalm-suppress

ImpureMethodCall

Return values
static

        
On this page

Search results