Registry / async / blocking

blocking

JSON →
library1.6.2rscratesunverified

A thread pool for isolating blocking I/O in async programs.

# Cargo.toml [dependencies] blocking = "1.6.2"
INSTALL
IMPORT
SIG · BLOCKING
B
blocking
asyncrustv1.6.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Unblock
use blocking::Unblock;

Wraps a blocking File in Unblock for async-friendly I/O.

use blocking::Unblock; use std::fs::File; use std::io::Read; let file = Unblock::new(File::open("Cargo.toml").unwrap()); let mut contents = String::new(); file.into_inner().read_to_string(&mut contents).unwrap(); println!("{}", contents);
Debug
Known issues
gotchaRequires an async runtime (e.g., smol, tokio) to drive the thread pool.
fix
Add a runtime dependency like `smol` or `tokio` and run the future with it.
affects: >=1.0.0
Upgrade
Version history
1.6.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
50 hits · last 30 days
node
44
OpenAI (training)
1
Resources
blocking — cargo add blocking · libregistry