Warning
Fastpool is deprecated and is being archived. Development has moved to asyncband::pool, which is the maintained successor. Fastpool 1.1.2 is the final planned release.
Fastpool provides fast and runtime-agnostic object pools for Async Rust.
You can read the docs page for a complete overview of the library.
Replace the Fastpool dependency with AsyncBand's pool feature:
cargo add asyncband --features poolFastpool's root items are available under asyncband::pool, while bounded and unbounded remain submodules. For example, replace fastpool::{ManageObject, bounded} with asyncband::pool::{ManageObject, bounded}.
AsyncBand 0.7.1 also strengthens several pool contracts. In particular, bounded::Pool::replenish is now replenish_to and returns a Result, and bounded::PoolStatus::wait_count has been removed. Review the AsyncBand pool documentation when migrating those APIs.
Read the online documents at https://docs.rs/fastpool.
This crate is built against the latest stable release, and its minimum supported rustc version is 1.85.0.
The policy is that the minimum Rust version required to use this crate can be increased in minor version updates. For example, if Fastpool 1.0 requires Rust 1.20.0, then Fastpool 1.0.z for all values of z will also require Rust 1.20.0 or newer. However, Fastpool 1.y for y > 0 may require a newer minimum version of Rust.
This project is licensed under Apache License, Version 2.0.
This library is a reimplementation of the deadpool crate with several dedicated considerations and a quite different mindset.
You can read the FAQ section on the docs page for a detailed discussion on "Why does fastpool have no timeout config?" and "Why does fastpool have no before/after hooks?"
The postgres example and this issue thread is a significant motivation for this crate:
- Keeps the crate runtime-agnostic (see also "Why does fastpool have no timeout config?")
- Keeps the abstraction really dead simple (see also "Why does fastpool have no before/after hooks?")
- Returns an
Arc<Pool>on creation so that maintenance could be triggered with a weak reference. This helps applications to teardown (drop) the pool easily with Rust's built-in RAII mechanism. See also this example.