external_service v0.8.1 ExternalService.RetryOptions View Source

Options used for controlling retry logic. See the retry docs for information about the available retry options.

Link to this section Summary

Types

A tuple describing the backoff strategy for increasing delay between retries

t()

Struct representing the retry options to apply to calls to external services

Link to this section Types

Link to this type backoff() View Source
backoff() ::
  {:exponential, initial_delay :: pos_integer()} |
  {:linear, initial_delay :: pos_integer(), factor :: pos_integer()}

A tuple describing the backoff strategy for increasing delay between retries.

The first element of the tuple must be one of the atoms :exponential or :linear. In both cases, the second element of the tuple is an integer representing the initial delay between retries, in milliseconds. For linear delay, there is also a third element in the tuple, which is a number representing the factor that the initial delay will be multiplied by on each successive retry.

Link to this type t() View Source
t() :: %ExternalService.RetryOptions{backoff: backoff(), cap: pos_integer() | nil, expiry: pos_integer() | nil, randomize: boolean()}

Struct representing the retry options to apply to calls to external services.

  • backoff: tuple describing the backoff strategy (see backoff/0)
  • randomize: boolean indicating whether or not delays between retries should be randomized
  • expiry: limit total length of time to allow for retries to the specified time budget milliseconds
  • cap: limit maximum amount of time between retries to the specified number of milliseconds