Skip to content

Commit 1fc8188

Browse files
committedFeb 28, 2024·
Add note about spawn_blocking to docs
1 parent a7ea5c9 commit 1fc8188

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
//!
2121
//! This library offers a flexible HTTP client interface with two modes:
2222
//! * **Synchronous (blocking)**
23+
//!
24+
//! NOTE: Be careful not to use a blocking HTTP client within `async` Rust code, which may panic
25+
//! or cause other issues. The
26+
//! [`tokio::task::spawn_blocking`](https://docs.rs/tokio/latest/tokio/task/fn.spawn_blocking.html)
27+
//! function may be useful in this situation.
2328
//! * **Asynchronous**
2429
//!
2530
//! ## Security Warning

0 commit comments

Comments
 (0)
Please sign in to comment.