Skip to content

Add pyresilience - #134

Open
AhsanSheraz wants to merge 1 commit into
timofurrer:mainfrom
AhsanSheraz:add-pyresilience
Open

AhsanSheraz wants to merge 1 commit into
timofurrer:mainfrom
AhsanSheraz:add-pyresilience

Conversation

@AhsanSheraz

@AhsanSheraz AhsanSheraz commented Nov 14, 2026 •

Copy link
Copy Markdown

What is this project?

pyresilience is a resilience library with seven patterns behind one @resilient() decorator: retry, circuit breaker, timeout, fallback, bulkhead, rate limiter and cache. The decorator detects coroutine functions, so the same code path covers async def functions without changes.

Link: https://github.com/AhsanSheraz/pyresilience

Added at the end of the Misc section.

Why is it awesome?

  • One decorator replaces a stack of single-purpose libraries (retry, circuit breaker, rate limiting) that otherwise have to be wired together by hand.
  • The patterns share state: the circuit breaker sees every retry, and a cache hit skips the rest of the pipeline.
  • It is safe under concurrency: latency tracking uses contextvars, and per-key locking prevents cache stampedes.
  • It has no dependencies. uvloop is an optional extra.
  • It is typed, MIT licensed, and tested on Python 3.10 to 3.15.

Disclosure: I am the author of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant