leasepool documentationΒΆ

leasepool is a local executor orchestration library for async Python applications.

It helps async services safely borrow execution capacity from ThreadPoolExecutor and ProcessPoolExecutor backends using leases, backpressure, expiry, adaptive sizing, batch submission, and clean shutdown.

Python 3.11+ support includes:

  • thread backend for blocking I/O and legacy synchronous SDKs.

  • process backend for CPU-heavy Python work.

  • interpreter backend reserved for Python 3.14+ InterpreterPoolExecutor.

Warning

leasepool is not a distributed task queue. It is not a replacement for Celery, Dramatiq, RQ, Ray, or a message broker. It manages local executor capacity inside one Python process.

User guide