Skip to main content

Async resilience utilities — circuit breaker, rate limiter, cache, http client

Project description

asyncresil

Async resilience utilities for Python services. A small, focused toolkit extracted from production code so the same primitives can be shared across projects instead of re-implemented per repo.

The GitHub repo is named aura-utils for historical reasons (this library was extracted from the Aura project's mcp_server/utils/). The PyPI package and Python module are both asyncresil — installed via pip install asyncresil and imported as from asyncresil import ….

Modules

Module What it does Why it exists
http_client httpx-based async client with retries, exponential backoff, and timeouts Transient network failures shouldn't surface to callers — retry the obvious cases.
circuit_breaker State machine (closedopenhalf_open) that fails fast when a downstream is broken Stops cascading failures and retry storms when a dependency is down.
rate_limiter Token-bucket limiter for async code Stay under third-party API limits, smooth bursts.
cache Cache protocol with MemoryCache (default) and RedisCache (optional dep) Skip repeat work — cut latency, cost, and downstream load.

The four compose into a typical outbound call chain:

caller → cache → rate_limiter → circuit_breaker → http_client → external service

Each layer protects the layers below from unnecessary load.

Install

pip install asyncresil                # core (in-memory cache only)
pip install 'asyncresil[redis]'       # adds Redis-backed cache

Requires Python 3.11+.

Intended consumers

Internal services that need a shared resilience layer:

  • Aura — MCP server (the original source of these utilities)
  • Eval Framework — uses the cache + rate limiter for batched LLM evaluation
  • Agentic Engine — uses the circuit breaker around tool calls
  • LLM Gateway — uses the http client + circuit breaker for upstream provider calls

Status

0.1.0 — early alpha. API is not yet stable.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asyncresil-0.1.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asyncresil-0.1.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file asyncresil-0.1.0.tar.gz.

File metadata

  • Download URL: asyncresil-0.1.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for asyncresil-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c8d6fce9a8b937020aac2dccf2a8d554fbe8acc4aa97c5806420f5ff7da30fe6
MD5 d245d7812e3d789b6e8ff5e5bc610b33
BLAKE2b-256 4e17ea995fbb955505e2b9d1d0fc607cd59468a1d596ef3e7cb7aa6d2b43a6a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for asyncresil-0.1.0.tar.gz:

Publisher: release.yml on kevinreber/aura-utils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file asyncresil-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: asyncresil-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for asyncresil-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9d8d2a9edd234bc584d533789d8b5871dabcd8e400044e48206a0a46213d091
MD5 fd839e9c653035fe5afa62ec99b9b5ec
BLAKE2b-256 258a0bf5515b49d5b738ddbc0ff6c649ad69730e11434d380eff8550c1a1b475

See more details on using hashes here.

Provenance

The following attestation bundles were made for asyncresil-0.1.0-py3-none-any.whl:

Publisher: release.yml on kevinreber/aura-utils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page