Documentation
¶
Overview ¶
Package retry adds retry resilience to individual Flow atoms through the AtomAdvise contract. When an atom carries :retry=N, the adviser consumes the modifier and installs the retry middleware before the modifier table sees the atom.
The `@require` options block can configure the default retry policy:
@require retry { default_max: "5", backoff: "exponential", retry_all: "false" }
Typical use:
flaky.service:retry=3
Index ¶
Constants ¶
const ( BackoffConstant = "constant" BackoffExponential = "exponential" BackoffExponentialJitter = "exponential_jitter" )
const ID = "retry"
Variables ¶
This section is empty.
Functions ¶
func Bundle ¶
Bundle satisfies the standard BundleFactory signature, so native.Bundles() can mount it the same way as every other bundle. Options come from the @require block, or from BundleWithConfig when the caller wants to pin the policy in code.
func BundleWithConfig ¶
BundleWithConfig returns the retry extension with an explicit policy.
Types ¶
type Config ¶
type Config struct {
DefaultMax int `nflow:"default_max" default:"3"`
Backoff string `nflow:"backoff" default:"exponential_jitter"`
MinBackoff time.Duration `nflow:"min_backoff" default:"10ms"`
MaxBackoff time.Duration `nflow:"max_backoff" default:"2s"`
RetryAll bool `nflow:"retry_all" default:"false"`
}
Config controls the retry policy installed by the adviser.