pub struct Worker<B: QueueBackend> { /* private fields */ }Expand description
Worker for processing jobs from a queue
Implementations§
Source§impl<B: QueueBackend + 'static> Worker<B>
 
impl<B: QueueBackend + 'static> Worker<B>
Sourcepub fn new(
    queue: Queue<B>,
    registry: WorkerRegistry,
    config: QueueConfig,
) -> Self
 
pub fn new( queue: Queue<B>, registry: WorkerRegistry, config: QueueConfig, ) -> Self
Create a new worker
Sourcepub async fn start(&self) -> QueueResult<()>
 
pub async fn start(&self) -> QueueResult<()>
Start processing jobs
Sourcepub async fn start_with_shutdown(
    &self,
    shutdown: Receiver<()>,
) -> QueueResult<()>
 
pub async fn start_with_shutdown( &self, shutdown: Receiver<()>, ) -> QueueResult<()>
Start processing with graceful shutdown
Sourcepub async fn stats(&self) -> QueueResult<WorkerStats>
 
pub async fn stats(&self) -> QueueResult<WorkerStats>
Get worker statistics
Auto Trait Implementations§
impl<B> Freeze for Worker<B>
impl<B> !RefUnwindSafe for Worker<B>
impl<B> Send for Worker<B>
impl<B> Sync for Worker<B>
impl<B> Unpin for Worker<B>
impl<B> !UnwindSafe for Worker<B>
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