pub struct JobQueue { /* private fields */ }Expand description
Persistent job queue
Implementations§
Source§impl JobQueue
impl JobQueue
pub fn new(storage_path: String) -> Result<Self>
Sourcepub async fn dequeue(&self) -> Result<Option<Job>>
pub async fn dequeue(&self) -> Result<Option<Job>>
Dequeue next job (highest priority, oldest first)
Sourcepub async fn cleanup_completed(&self) -> Result<usize>
pub async fn cleanup_completed(&self) -> Result<usize>
Remove completed jobs (cleanup)
Sourcepub async fn stats(&self) -> Result<QueueStats>
pub async fn stats(&self) -> Result<QueueStats>
Get queue statistics
Auto Trait Implementations§
impl Freeze for JobQueue
impl !RefUnwindSafe for JobQueue
impl Send for JobQueue
impl Sync for JobQueue
impl Unpin for JobQueue
impl !UnwindSafe for JobQueue
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