How registration with the kernel is retried: capped exponential backoff with jitter, a maximum
number of attempts, and a distinction between failures worth retrying and failures that will
never succeed. Mirrors the .NET client's RegistrationRetryOptions / RegistrationBackoff.
Configure it with the :registration option of Chronicle.Client:
{Chronicle.Client,
registration: [initial_delay: 1_000, max_delay: 5_000, jitter: 0.2, max_attempts: 10]}:initial_delay- the delay after the first failure in milliseconds (default5_000):max_delay- the cap of the exponential growth (default5_000, so by default the delay stays fixed at:initial_delay, as it always has; raise it to get growth):multiplier- growth factor between attempts (default2):jitter- fraction of the delay randomly added or removed,0.0to1.0(default0.0):max_attempts- give up after this many failed attempts (default:infinity)
A registration the kernel rejects as invalid (a validation failure, an invalid argument) is not retried: repeating it cannot change the answer. It is reported as failed immediately.
Summary
Functions
The delay in milliseconds before attempt number failed_attempts + 1.
Builds a policy from :registration options.
Whether another attempt should be made after failed_attempts failures with reason.
Whether a failure could succeed if repeated.
Types
@type t() :: %Chronicle.Registration.RetryPolicy{ initial_delay: pos_integer(), jitter: float(), max_attempts: pos_integer() | :infinity, max_delay: pos_integer(), multiplier: number() }
Functions
@spec delay(t(), pos_integer(), (-> float())) :: non_neg_integer()
The delay in milliseconds before attempt number failed_attempts + 1.
random is a function returning a float in [0.0, 1.0), injectable for tests.
Builds a policy from :registration options.
@spec retry?(t(), pos_integer(), term()) :: boolean()
Whether another attempt should be made after failed_attempts failures with reason.
Whether a failure could succeed if repeated.