pub struct MemoryJobQueue { /* private fields */ }Expand description
In-process JobQueue impl.
Implementations§
Trait Implementations§
Source§impl JobQueue for MemoryJobQueue
impl JobQueue for MemoryJobQueue
Source§fn enqueue<'life0, 'life1, 'async_trait>(
&'life0 self,
queue: &'life1 str,
job: Job,
) -> Pin<Box<dyn Future<Output = Result<JobId, BusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn enqueue<'life0, 'life1, 'async_trait>(
&'life0 self,
queue: &'life1 str,
job: Job,
) -> Pin<Box<dyn Future<Output = Result<JobId, BusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Enqueue a job. Returns a stable id.
Source§fn claim<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queue: &'life1 str,
_worker_id: &'life2 str,
lease_ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<ClaimedJob>, BusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn claim<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
queue: &'life1 str,
_worker_id: &'life2 str,
lease_ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<ClaimedJob>, BusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Claim the next available job. Returns
None when the queue is
empty. Implementations may long-poll up to a small bounded
duration before returning None.Auto Trait Implementations§
impl !Freeze for MemoryJobQueue
impl !RefUnwindSafe for MemoryJobQueue
impl !UnwindSafe for MemoryJobQueue
impl Send for MemoryJobQueue
impl Sync for MemoryJobQueue
impl Unpin for MemoryJobQueue
impl UnsafeUnpin for MemoryJobQueue
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