pub struct RedisWorkQueue<WI: WorkItem> { /* private fields */ }Expand description
Redis implementation of the WorkQueue trait.
Implementations§
Source§impl<WI: WorkItem> RedisWorkQueue<WI>
impl<WI: WorkItem> RedisWorkQueue<WI>
Sourcepub fn new(client: RedisClient) -> Self
pub fn new(client: RedisClient) -> Self
Create a new Redis work queue with the given client.
Trait Implementations§
Source§impl<WI: Clone + WorkItem> Clone for RedisWorkQueue<WI>
impl<WI: Clone + WorkItem> Clone for RedisWorkQueue<WI>
Source§fn clone(&self) -> RedisWorkQueue<WI>
fn clone(&self) -> RedisWorkQueue<WI>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<C: Context, WI> WorkQueue<C, WI> for RedisWorkQueue<WI>
impl<C: Context, WI> WorkQueue<C, WI> for RedisWorkQueue<WI>
Source§fn enqueue<'life0, 'life1, 'async_trait>(
&'life0 self,
workflow_id: &'life1 str,
work: WI,
) -> Pin<Box<dyn Future<Output = Result<(), WorkQueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn enqueue<'life0, 'life1, 'async_trait>(
&'life0 self,
workflow_id: &'life1 str,
work: WI,
) -> Pin<Box<dyn Future<Output = Result<(), WorkQueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Enqueue one work-item under this
workflow_id.
Returns Err(WorkQueueError) on failure.Source§fn dequeue<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<(String, WI)>, WorkQueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dequeue<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<(String, WI)>, WorkQueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dequeue the next available work-item from any workflow.
Returns Ok(Some((workflow_id, item))) if an item was dequeued,
Ok(None) if the queue is empty,
or Err(WorkQueueError) on failure.
Source§fn purge_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), WorkQueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn purge_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), WorkQueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Purge all work items for a given workflow run.
Removes all queued work for the specified run_id.
Auto Trait Implementations§
impl<WI> Freeze for RedisWorkQueue<WI>
impl<WI> !RefUnwindSafe for RedisWorkQueue<WI>
impl<WI> Send for RedisWorkQueue<WI>
impl<WI> Sync for RedisWorkQueue<WI>
impl<WI> Unpin for RedisWorkQueue<WI>where
WI: Unpin,
impl<WI> !UnwindSafe for RedisWorkQueue<WI>
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