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§
Source§impl 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>
pub fn builder<CONTEXT>( queue: &Queue, context: CONTEXT, ) -> WorkerBuilder<'_, CONTEXT>
Create a WorkerBuilder to build a new worker.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Worker
impl !RefUnwindSafe for Worker
impl Send for Worker
impl Sync for Worker
impl Unpin for Worker
impl !UnwindSafe for Worker
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