View Source ExternalService.RetryOptions (external_service v1.1.4)

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

@type 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.

@type t() :: %ExternalService.RetryOptions{
  backoff: backoff(),
  cap: pos_integer() | nil,
  expiry: pos_integer() | nil,
  randomize: boolean(),
  rescue_only: [module()]
}

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
  • rescue_only: retry only on exceptions matching one of the list of provided exception types, (defaults to [RuntimeError])

Link to this section Functions