pub struct Processor { /* private fields */ }Implementations§
Source§impl Processor
impl Processor
pub fn new(redis: RedisPool, queues: Vec<String>) -> Self
pub fn with_config(self, config: ProcessorConfig) -> Self
pub async fn fetch(&mut self) -> Result<Option<UnitOfWork>>
pub async fn process_one(&mut self) -> Result<()>
pub async fn process_one_tick_once(&mut self) -> Result<WorkFetcher>
pub fn register<Args: Sync + Send + for<'de> Deserialize<'de> + 'static, W: Worker<Args> + 'static>( &mut self, worker: W, )
pub fn get_cancellation_token(&self) -> CancellationToken
Sourcepub async fn run(self)
pub async fn run(self)
Takes self to consume the processor. This is for life-cycle management, not memory safety because you can clone processor pretty easily.
pub async fn using<M>(&mut self, middleware: M)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Processor
impl !RefUnwindSafe for Processor
impl Send for Processor
impl Sync for Processor
impl Unpin for Processor
impl UnsafeUnpin for Processor
impl !UnwindSafe for Processor
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