Skip to main content

bounded

Function bounded 

Source
pub fn bounded<T>(
    workers: NonZeroUsize,
    capacity: usize,
) -> (WorkQueueSender<T>, Vec<WorkQueueReceiver<T>>)
Expand description

Creates a bounded work queue with workers workers.

Returns a sender, which can be cloned to create additional producers, along with one receiver per worker. capacity is the total number of items that can be queued, and is split evenly across the workers, with each worker able to queue at least one item.