pub struct ProcessorMap<S>where
    S: Clone,
{ /* private fields */ }
Expand description

A type for storing the relationships between processor names and the processor itself

Processors must be registered with the ProcessorMap in the initialization phase of an application before workers are spawned in order to handle queued jobs.

Implementations

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.

Register a Processor with this ProcessorMap.

ProcessorMaps are useless if no processors are registerd before workers are spawned, so make sure to register all your processors up-front.

Process a given job

This should not be called from outside implementations of a backgoround-jobs runtime. It is intended for internal use.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.