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

#42 in Asynchronous

Download history 39889/week @ 2024-08-02 43649/week @ 2024-08-09 42667/week @ 2024-08-16 39392/week @ 2024-08-23 40558/week @ 2024-08-30 44423/week @ 2024-09-06 42351/week @ 2024-09-13 42383/week @ 2024-09-20 44105/week @ 2024-09-27 50490/week @ 2024-10-04 46059/week @ 2024-10-11 48030/week @ 2024-10-18 42556/week @ 2024-10-25 35912/week @ 2024-11-01 38381/week @ 2024-11-08 41428/week @ 2024-11-15

166,672 downloads per month
Used in 248 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