Spectre.Operation.Retry (Spectre v0.3.0)

Copy Markdown View Source

Portable retry and backoff policy for a registered operation.

Summary

Types

t()

@type t() :: %Spectre.Operation.Retry{
  base_delay_ms: non_neg_integer(),
  max_attempts: pos_integer(),
  max_delay_ms: non_neg_integer(),
  retry_on: [atom()],
  strategy: :constant | :linear | :exponential
}

Functions

delay(retry, attempt)

@spec delay(t(), pos_integer()) :: non_neg_integer()

new(retry)

@spec new(t() | map() | keyword() | nil) :: t()

retry?(retry, reason_class, attempt)

@spec retry?(t(), atom(), pos_integer()) :: boolean()