9 unstable releases (3 breaking)
Uses new Rust 2024
new 0.4.2 | May 7, 2025 |
---|---|
0.4.1 | May 7, 2025 |
0.3.0 | May 7, 2025 |
0.2.1 | May 4, 2025 |
0.1.1 | Feb 25, 2025 |
#34 in #hook
915 downloads per month
54KB
812 lines
Fastpool
Overview
Fastpool provides fast and runtime-agnostic object pools for Async Rust.
You can read the docs page for a complete overview of the library.
Installation
Add the dependency to your Cargo.toml
via:
cargo add fastpool
Documentation
Read the online documents at https://docs.rs/fastpool.
Minimum Supported Rust Version (MSRV)
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.
License
This project is licensed under Apache License, Version 2.0.
Origins
This library is derived from the deadpool crate with several dedicated considerations and a quite different mindset.
You can read the FAQ section on the docs page for 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.
Dependencies
~210KB