esdb_gater_retry (reckon_gater v1.1.2)
View SourceRetry logic with exponential backoff for reckon-gater
Provides configurable retry behavior with: - Exponential backoff with jitter - Maximum delay cap - Maximum retry count - Telemetry integration
Summary
Functions
Calculate delay for a given attempt (useful for testing)
Get default retry configuration from application environment
Execute a function with default retry configuration
Execute a function with custom retry configuration
Types
-type retry_config() :: #retry_config{base_delay_ms :: pos_integer(), max_delay_ms :: pos_integer(), max_retries :: non_neg_integer()}.
Functions
-spec calculate_delay(non_neg_integer(), retry_config()) -> non_neg_integer().
Calculate delay for a given attempt (useful for testing)
-spec default_config() -> retry_config().
Get default retry configuration from application environment
-spec with_retry(atom(), fun(() -> retry_result())) -> retry_result().
Execute a function with default retry configuration
-spec with_retry(atom(), fun(() -> retry_result()), retry_config()) -> retry_result().
Execute a function with custom retry configuration