12 releases (6 breaking)

0.7.0 Nov 19, 2021
0.6.0 Sep 7, 2020
0.5.0 Nov 4, 2019
0.3.3 Jan 30, 2019
0.3.0 Jun 28, 2018

#110 in Asynchronous

Download history 9239/week @ 2022-06-09 11192/week @ 2022-06-16 10486/week @ 2022-06-23 10039/week @ 2022-06-30 6849/week @ 2022-07-07 8664/week @ 2022-07-14 9946/week @ 2022-07-21 10716/week @ 2022-07-28 11806/week @ 2022-08-04 14076/week @ 2022-08-11 12829/week @ 2022-08-18 9619/week @ 2022-08-25 11118/week @ 2022-09-01 10664/week @ 2022-09-08 11176/week @ 2022-09-15 9577/week @ 2022-09-22

44,808 downloads per month
Used in 38 crates (11 directly)

MIT/Apache

42KB
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.45.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

~2MB
~32K SLoC