pub struct MemoryBackend { /* private fields */ }Expand description
In-memory queue backend
Implementations§
Source§impl MemoryBackend
impl MemoryBackend
Sourcepub fn new(config: QueueConfig) -> Self
pub fn new(config: QueueConfig) -> Self
Create a new memory backend
Trait Implementations§
Source§impl QueueBackend for MemoryBackend
impl QueueBackend for MemoryBackend
Source§fn requeue_job<'life0, 'async_trait>(
&'life0 self,
job_id: JobId,
_job: JobEntry,
) -> Pin<Box<dyn Future<Output = QueueResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn requeue_job<'life0, 'async_trait>(
&'life0 self,
job_id: JobId,
_job: JobEntry,
) -> Pin<Box<dyn Future<Output = QueueResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Atomic requeue implementation for memory backend
Source§fn clear_jobs_by_state<'life0, 'async_trait>(
&'life0 self,
state: JobState,
) -> Pin<Box<dyn Future<Output = QueueResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear_jobs_by_state<'life0, 'async_trait>(
&'life0 self,
state: JobState,
) -> Pin<Box<dyn Future<Output = QueueResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Atomic clear jobs by state implementation for memory backend
Source§fn enqueue<'life0, 'async_trait>(
&'life0 self,
job: JobEntry,
) -> Pin<Box<dyn Future<Output = QueueResult<JobId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn enqueue<'life0, 'async_trait>(
&'life0 self,
job: JobEntry,
) -> Pin<Box<dyn Future<Output = QueueResult<JobId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Enqueue a job
Source§fn dequeue<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = QueueResult<Option<JobEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dequeue<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = QueueResult<Option<JobEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dequeue the next available job
Source§fn complete<'life0, 'async_trait>(
&'life0 self,
job_id: JobId,
result: JobResult<()>,
) -> Pin<Box<dyn Future<Output = QueueResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn complete<'life0, 'async_trait>(
&'life0 self,
job_id: JobId,
result: JobResult<()>,
) -> Pin<Box<dyn Future<Output = QueueResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Mark a job as completed
Source§fn get_job<'life0, 'async_trait>(
&'life0 self,
job_id: JobId,
) -> Pin<Box<dyn Future<Output = QueueResult<Option<JobEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_job<'life0, 'async_trait>(
&'life0 self,
job_id: JobId,
) -> Pin<Box<dyn Future<Output = QueueResult<Option<JobEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get job by ID
Source§fn get_jobs_by_state<'life0, 'async_trait>(
&'life0 self,
state: JobState,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = QueueResult<Vec<JobEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_jobs_by_state<'life0, 'async_trait>(
&'life0 self,
state: JobState,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = QueueResult<Vec<JobEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get jobs by state
Source§fn remove_job<'life0, 'async_trait>(
&'life0 self,
job_id: JobId,
) -> Pin<Box<dyn Future<Output = QueueResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove_job<'life0, 'async_trait>(
&'life0 self,
job_id: JobId,
) -> Pin<Box<dyn Future<Output = QueueResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove a job from the queue
Source§fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = QueueResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = QueueResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clear all jobs from the queue
Source§fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = QueueResult<QueueStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = QueueResult<QueueStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get queue statistics
Auto Trait Implementations§
impl Freeze for MemoryBackend
impl !RefUnwindSafe for MemoryBackend
impl Send for MemoryBackend
impl Sync for MemoryBackend
impl Unpin for MemoryBackend
impl !UnwindSafe for MemoryBackend
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