mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-25 12:00:35 +00:00
runtime: document the queue behavior of spawn_blocking
(#7269)
This commit is contained in:
parent
d41d49d202
commit
ce87dcfbf0
@ -445,6 +445,15 @@ impl Builder {
|
||||
///
|
||||
/// The default value is 512.
|
||||
///
|
||||
/// # Queue Behavior
|
||||
///
|
||||
/// When a blocking task is submitted, it will be inserted into a queue. If available, one of
|
||||
/// the idle threads will be notified to run the task. Otherwise, if the threshold set by this
|
||||
/// method has not been reached, a new thread will be spawned. If no idle thread is available
|
||||
/// and no more threads are allowed to be spawned, the task will remain in the queue until one
|
||||
/// of the busy threads pick it up. Note that since the queue does not apply any backpressure,
|
||||
/// it could potentially grow unbounded.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// This will panic if `val` is not larger than `0`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user