13 unstable releases

0.7.1 Dec 7, 2022
0.7.0 Nov 19, 2021
0.6.0 Sep 7, 2020
0.5.0 Nov 4, 2019
0.3.0 Jun 28, 2018

#41 in Asynchronous

Download history 41112/week @ 2024-07-21 40449/week @ 2024-07-28 40836/week @ 2024-08-04 43922/week @ 2024-08-11 41850/week @ 2024-08-18 40730/week @ 2024-08-25 41739/week @ 2024-09-01 43401/week @ 2024-09-08 41157/week @ 2024-09-15 42404/week @ 2024-09-22 45807/week @ 2024-09-29 50050/week @ 2024-10-06 45855/week @ 2024-10-13 47741/week @ 2024-10-20 40692/week @ 2024-10-27 36581/week @ 2024-11-03

172,926 downloads per month
Used in 262 crates (20 directly)

MIT/Apache

43KB
656 lines

futures-locks

A library of Futures-aware locking primitives. These locks can safely be used in asynchronous environments like Tokio. When they block, they'll only block a single task, not the entire reactor.

Build Status CodeCov.io

# Cargo.toml
[dependencies]
futures = "0.3.1"
futures-locks = "0.6"

Usage

Generally, the provided primitives work much like their counterparts from the standard library. But instead of blocking until ready, they return Futures which will become ready when the lock is acquired. See the doc comments for individual examples.

futures-locks requires Rust 1.49.0 or higher.

License

futures-locks is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, and LICENSE-MIT for details

Dependencies

~2–7.5MB
~49K SLoC