pub struct Worker {
pub id: u64,
/* private fields */
}Expand description
A worker that runs jobs from the queue.
Fields
id: u64The worker’s internal ID.
Implementations
sourceimpl Worker
impl Worker
sourcepub async fn unregister(self, timeout: Option<Duration>) -> Result<()>
pub async fn unregister(self, timeout: Option<Duration>) -> Result<()>
Unregister a worker from the queue. It will still finish any jobs it is currently running, but will no longer take new jobs.
sourcepub fn builder<CONTEXT>(
queue: &Queue,
context: CONTEXT
) -> WorkerBuilder<'_, CONTEXT>where
CONTEXT: Send + Sync + Debug + Clone + 'static,
pub fn builder<CONTEXT>(
queue: &Queue,
context: CONTEXT
) -> WorkerBuilder<'_, CONTEXT>where
CONTEXT: Send + Sync + Debug + Clone + 'static,
Create a WorkerBuilder to build a new worker.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Worker
impl Send for Worker
impl Sync for Worker
impl Unpin for Worker
impl !UnwindSafe for Worker
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