pub struct WorkDispatcher<P: Producer, C: Processor<Item = P::Item>> { /* private fields */ }Expand description
The WorkDispatcher orchestrates the entire concurrent dispatcher.
Implementations§
Source§impl<P, C> WorkDispatcher<P, C>
impl<P, C> WorkDispatcher<P, C>
Sourcepub fn new(producer: P, processor: C, context: C::Context) -> Self
pub fn new(producer: P, processor: C, context: C::Context) -> Self
Creates a new WorkDispatcher with a producer, a processor, and a shared context.
Sourcepub fn workers(self, count: usize) -> Self
pub fn workers(self, count: usize) -> Self
Sets the number of concurrent worker tasks. Defaults to the number of logical CPU cores.
Auto Trait Implementations§
impl<P, C> Freeze for WorkDispatcher<P, C>
impl<P, C> RefUnwindSafe for WorkDispatcher<P, C>
impl<P, C> Send for WorkDispatcher<P, C>
impl<P, C> Sync for WorkDispatcher<P, C>
impl<P, C> Unpin for WorkDispatcher<P, C>
impl<P, C> UnsafeUnpin for WorkDispatcher<P, C>
impl<P, C> UnwindSafe for WorkDispatcher<P, C>
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