pub struct WorkQueueSender<T> { /* private fields */ }Expand description
The sending side of a work queue.
Cloning a sender creates another producer for the same work queue. Each clone balances independently.
Implementations§
Source§impl<T> WorkQueueSender<T>
impl<T> WorkQueueSender<T>
Sourcepub async fn send(&mut self, item: T) -> Result<(), SendError<T>>
pub async fn send(&mut self, item: T) -> Result<(), SendError<T>>
Sends an item to one of the workers.
Workers that have stopped are skipped. If every running worker’s queue is full, waits until any running worker has room.
§Errors
If every worker has stopped, an error is returned with the item.
Trait Implementations§
Source§impl<T> Clone for WorkQueueSender<T>
impl<T> Clone for WorkQueueSender<T>
Auto Trait Implementations§
impl<T> Freeze for WorkQueueSender<T>
impl<T> RefUnwindSafe for WorkQueueSender<T>
impl<T> Send for WorkQueueSender<T>where
T: Send,
impl<T> Sync for WorkQueueSender<T>where
T: Send,
impl<T> Unpin for WorkQueueSender<T>
impl<T> UnsafeUnpin for WorkQueueSender<T>
impl<T> UnwindSafe for WorkQueueSender<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Track for T
impl<T> Track for T
Source§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self> ⓘ
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self> ⓘ
Instruments this type by attaching the given resource group token, returning a
Tracked wrapper. Read more