Struct background_jobs_core::ProcessorMap
source · pub struct ProcessorMap<S>where
S: Clone,{ /* private fields */ }
Expand description
A type for storing the relationships between processor names and the processor itself
Processor
s must
be registered with the ProcessorMap
in the initialization phase of an application before
workers are spawned in order to handle queued jobs.
Implementations
sourceimpl<S> ProcessorMap<S>where
S: Clone + Send + Sync + 'static,
impl<S> ProcessorMap<S>where
S: Clone + Send + Sync + 'static,
sourcepub fn new(state: S) -> Self
pub fn new(state: S) -> Self
Intialize a ProcessorMap
The state passed into this method will be passed to all jobs executed through this ProcessorMap. The state argument could be useful for containing a hook into something like r2d2, or the address of an actor in an actix-based system.
Auto Trait Implementations
impl<S> !RefUnwindSafe for ProcessorMap<S>
impl<S> Send for ProcessorMap<S>where
S: Send,
impl<S> Sync for ProcessorMap<S>where
S: Sync,
impl<S> Unpin for ProcessorMap<S>where
S: Unpin,
impl<S> !UnwindSafe for ProcessorMap<S>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more