pub struct LocalFileFlowTaskQueue { /* private fields */ }Expand description
JSON-backed local durable task queue.
Tasks are stored as one JSON file per pending item under <root>/pending.
The queue serializes access inside the current process. It is intended for
embedded hosts and local crash/restart durability of pending tasks; it does
not provide cross-process locking.
Implementations§
Source§impl LocalFileFlowTaskQueue
impl LocalFileFlowTaskQueue
pub fn new(root: impl Into<PathBuf>) -> Self
pub fn root(&self) -> &Path
pub async fn inflight_len(&self) -> Result<usize>
pub async fn dead_letter_len(&self) -> Result<usize>
pub async fn dead_lettered_tasks( &self, ) -> Result<Vec<LocalFileDeadLetteredTask>>
pub async fn requeue_inflight_older_than( &self, cutoff: DateTime<Utc>, ) -> Result<usize>
pub async fn dead_letter_inflight_older_than( &self, cutoff: DateTime<Utc>, reason: impl Into<String>, ) -> Result<usize>
Trait Implementations§
Source§impl Clone for LocalFileFlowTaskQueue
impl Clone for LocalFileFlowTaskQueue
Source§fn clone(&self) -> LocalFileFlowTaskQueue
fn clone(&self) -> LocalFileFlowTaskQueue
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 Debug for LocalFileFlowTaskQueue
impl Debug for LocalFileFlowTaskQueue
Source§impl FlowTaskQueue for LocalFileFlowTaskQueue
impl FlowTaskQueue for LocalFileFlowTaskQueue
fn enqueue<'life0, 'async_trait>(
&'life0 self,
task: FlowTask,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn lease<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<FlowTaskLease>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ack<'life0, 'life1, 'async_trait>(
&'life0 self,
lease_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn requeue_inflight<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn len<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dequeue<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<FlowTask>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for LocalFileFlowTaskQueue
impl !UnwindSafe for LocalFileFlowTaskQueue
impl Freeze for LocalFileFlowTaskQueue
impl Send for LocalFileFlowTaskQueue
impl Sync for LocalFileFlowTaskQueue
impl Unpin for LocalFileFlowTaskQueue
impl UnsafeUnpin for LocalFileFlowTaskQueue
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