Overview of stamina features
mainstamina is an opinionated wrapper around Tenacity designed for ergonomics and safety in distributed systems. Key features include:
- Selective Retries: Retry only on specific exceptions or use a backoff hook to introspect exceptions.
- Resilient Backoff: Exponential backoff with jitter is used by default.
- Safety Limits: Limits both the number of retries (
attempts) and the total elapsed time. - Async Support: Native support for
asynccallables andTrio. - Type Safety: Preserves type hints of the decorated callable.
- Instrumentation: Out-of-the-box support for
Prometheus,structlog, and standard librarylogging. - Testability: Dedicated support for testing that allows globally deactivating retries, limiting retry counts, or removing backoffs.