pub struct InMemoryWorkQueue<WI>(/* private fields */)
where
WI: WorkItem;Expand description
In-memory implementation of WorkQueue for testing and local development.
Implementations§
Source§impl<WI> InMemoryWorkQueue<WI>where
WI: WorkItem,
impl<WI> InMemoryWorkQueue<WI>where
WI: WorkItem,
pub fn new() -> InMemoryWorkQueue<WI>
Trait Implementations§
Source§impl<WI> Clone for InMemoryWorkQueue<WI>
impl<WI> Clone for InMemoryWorkQueue<WI>
Source§fn clone(&self) -> InMemoryWorkQueue<WI>
fn clone(&self) -> InMemoryWorkQueue<WI>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<WI> Default for InMemoryWorkQueue<WI>where
WI: WorkItem,
impl<WI> Default for InMemoryWorkQueue<WI>where
WI: WorkItem,
Source§fn default() -> InMemoryWorkQueue<WI>
fn default() -> InMemoryWorkQueue<WI>
Returns the “default value” for a type. Read more
Source§impl<C, WI> WorkQueue<C, WI> for InMemoryWorkQueue<WI>
impl<C, WI> WorkQueue<C, WI> for InMemoryWorkQueue<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
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryWorkQueue<WI>: '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
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryWorkQueue<WI>: '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
'life0: 'async_trait,
InMemoryWorkQueue<WI>: 'async_trait,
fn dequeue<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<(String, WI)>, WorkQueueError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemoryWorkQueue<WI>: '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
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryWorkQueue<WI>: '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
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryWorkQueue<WI>: 'async_trait,
Purge all work items for a given workflow run.
Removes all queued work for the specified run_id.
Source§fn pending_work<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<WI>, WorkQueueError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryWorkQueue<WI>: 'async_trait,
fn pending_work<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<WI>, WorkQueueError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryWorkQueue<WI>: 'async_trait,
Get pending work for a run.
Auto Trait Implementations§
impl<WI> !RefUnwindSafe for InMemoryWorkQueue<WI>
impl<WI> !UnwindSafe for InMemoryWorkQueue<WI>
impl<WI> Freeze for InMemoryWorkQueue<WI>
impl<WI> Send for InMemoryWorkQueue<WI>
impl<WI> Sync for InMemoryWorkQueue<WI>
impl<WI> Unpin for InMemoryWorkQueue<WI>
impl<WI> UnsafeUnpin for InMemoryWorkQueue<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