Skip to main content

TaskDispatchStore

Trait TaskDispatchStore 

Source
pub trait TaskDispatchStore: Send + Sync {
    // Provided methods
    fn get_pending_tasks_by_priority<'life0, 'async_trait>(
        &'life0 self,
        _limit: i64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn get_stuck_tasks<'life0, 'async_trait>(
        &'life0 self,
        _timeout_secs: i64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn get_recently_completed_tasks<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _since: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn mark_task_interrupted<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _task_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Task dispatch bookkeeping for executor scheduling and recovery.

Provided Methods§

Source

fn get_pending_tasks_by_priority<'life0, 'async_trait>( &'life0 self, _limit: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get pending tasks ordered by priority, filtering out those with unmet dependencies.

Source

fn get_stuck_tasks<'life0, 'async_trait>( &'life0 self, _timeout_secs: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get tasks stuck in running/claimed state longer than timeout_secs.

Source

fn get_recently_completed_tasks<'life0, 'life1, 'async_trait>( &'life0 self, _since: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get tasks completed after a given timestamp.

Source

fn mark_task_interrupted<'life0, 'life1, 'async_trait>( &'life0 self, _task_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Mark a running/claimed task as interrupted (e.g., after crash or timeout).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§