Comparisons
Retries
Failsafe-go vs cenkalti/backoff
cenkalti/backoff is an expontial backoff retry implementation. It differs from Failsafe-go’s RetryPolicy in a few ways:
- Failsafe-go allows you to combine settings for any retry scenario, including fixed, backoff, or random delays, jitter, max retries, and max duration, through a single interface.
- Failsafe-go retries can be configured to handle different results, errors, or conditions.
- Failsafe-go retries can be aborted on different results, errors, or conditions.
- Failsafe-go provides several retry related event listeners.
- Failsafe-go can perform asynchronous executions with retries.
- Failsafe-go retry policies are concurrency safe.
- Failsafe-go retries can can receive execution info.
- Failsafe-go retries can cooperate with cancellation.
- Failsafe-go retry backoff delays are computed automatically. cenkalti/backoff requires you to call a function on each attempt.
- Failsafe-go retries can be composed with other policies.
Circuit Breakers
Failsafe-go vs gobreaker
gobreaker is a circuit breaker implementation. It differs from Failsafe-go’s CircuitBreaker in a few ways:
- Failsafe-go offers count-based and time-based thresholding. gobreaker only offers count-based thresholding.
- Failsafe-go’s circuit breaker provides a single interface for configuring any scenario. gobreaker has different structs for different types of circuit breaking.
- Failsafe-go circuit breakers can threshold on recent execution results. gobreaker periodically clears execution results, losing recent data.
- Failsafe-go circuit breakers can be configured to handle different results, errors, or conditions.
- Failsafe-go circuit breakers can be configured with separate failure and success thresholds.
- Failsafe-go provides several circuit breaker event listeners.
- Failsafe-go circuit breakers can be manually operated.
- Failsafe-go circuit breakers can be composed with other policies.
Hedges
Failsafe-go vs cristalhq/hedgedhttp
cristalhq/hedgedhttp is an HTTP hedging implemetation. It differs from Failsafe-go’s HedgePolicy in a few ways:
- Failsafe-go hedges can be used with any type of execution. cristalhq/hedgedhttp is based on HTTP.
- Failsafe-go hedges allow you to configure which results/errors to cancel outstanding hedges based on. cristalhq/hedgedhttp treats any non-error as a success.
- Failsafe-go supports dynamic hedge delays.
- Failsafe-go provides hedge event listeners.
- Failsafe-go hedges can be composed with other policies.