Foundation.Backoff.Policy (foundation v0.2.1)

Copy Markdown View Source

Backoff policy configuration.

Summary

Types

jitter_strategy()

@type jitter_strategy() :: :none | :factor | :additive | :range

rand_fun()

@type rand_fun() :: (-> float()) | (pos_integer() -> pos_integer())

strategy()

@type strategy() :: :exponential | :linear | :constant

t()

@type t() :: %Foundation.Backoff.Policy{
  base_ms: pos_integer(),
  jitter: float() | {float(), float()},
  jitter_strategy: jitter_strategy(),
  max_ms: pos_integer() | nil,
  rand_fun: rand_fun(),
  strategy: strategy()
}

Functions

new(opts \\ [])

@spec new(keyword()) :: t()