#async #semaphore #thread

blocking-permit

Permits and a thread pool for blocking operations

8 releases (stable)

1.3.2 Jan 28, 2021
1.3.1 Jan 23, 2021
1.2.1 Aug 29, 2020
1.2.0 Feb 4, 2020
0.1.0 Dec 20, 2019

#122 in Asynchronous

Download history 37/week @ 2020-11-06 20/week @ 2020-11-13 7/week @ 2020-11-20 13/week @ 2020-11-27 48/week @ 2020-12-04 19/week @ 2020-12-11 16/week @ 2020-12-18 14/week @ 2020-12-25 27/week @ 2021-01-01 173/week @ 2021-01-08 105/week @ 2021-01-15 166/week @ 2021-01-22 49/week @ 2021-01-29 35/week @ 2021-02-05 61/week @ 2021-02-12 21/week @ 2021-02-19

219 downloads per month
Used in 2 crates (via body-image-futio)

MIT/Apache

66KB
1.5K SLoC

blocking-permit

Rustdoc Change Log crates.io CI Status

This crate provides:

  • A specialized, custom thread pool, DispatchPool, for offloading blocking or otherwise long running operations from a main or reactor threads.

  • A BlockingPermit for limiting the number of concurrent blocking operations via a Semaphore type.

  • A Cleaver for splitting Stream buffers into more manageable sizes.

  • A YieldStream for yielding between Stream items.

Minimum supported rust version

MSRV := 1.45.2

The crate will fail fast on any lower rustc (via a build.rs version check) and is also CI tested on this version.

License

This project is dual licensed under either of following:

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in blocking-permit by you, as defined by the Apache License, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.6–1.3MB
~23K SLoC