TaskStore

Trait TaskStore 

Source
pub trait TaskStore:
    Send
    + Sync
    + 'static {
    type Connection: Send;

    // Required methods
    fn pull_next_task<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        queue_name: &'life1 str,
        execution_timeout: Option<Duration>,
        task_names: &'life2 [String],
    ) -> Pin<Box<dyn Future<Output = Result<Option<Task>, AsyncQueueError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn set_task_state<'life0, 'async_trait>(
        &'life0 self,
        id: TaskId,
        state: TaskState,
    ) -> Pin<Box<dyn Future<Output = Result<(), AsyncQueueError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove_task<'life0, 'async_trait>(
        &'life0 self,
        id: TaskId,
    ) -> Pin<Box<dyn Future<Output = Result<u64, AsyncQueueError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn schedule_task_retry<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: TaskId,
        backoff: Duration,
        error: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Task, AsyncQueueError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn enqueue<'life0, 'async_trait, T>(
        conn: &'life0 mut Self::Connection,
        task: T,
    ) -> Pin<Box<dyn Future<Output = Result<(), AsyncQueueError>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait,
             T: 'async_trait + BackgroundTask,
             'life0: 'async_trait;
}

Required Associated Types§

Required Methods§

Source

fn pull_next_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, queue_name: &'life1 str, execution_timeout: Option<Duration>, task_names: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<Option<Task>, AsyncQueueError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn set_task_state<'life0, 'async_trait>( &'life0 self, id: TaskId, state: TaskState, ) -> Pin<Box<dyn Future<Output = Result<(), AsyncQueueError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn remove_task<'life0, 'async_trait>( &'life0 self, id: TaskId, ) -> Pin<Box<dyn Future<Output = Result<u64, AsyncQueueError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn schedule_task_retry<'life0, 'life1, 'async_trait>( &'life0 self, id: TaskId, backoff: Duration, error: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Task, AsyncQueueError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn enqueue<'life0, 'async_trait, T>( conn: &'life0 mut Self::Connection, task: T, ) -> Pin<Box<dyn Future<Output = Result<(), AsyncQueueError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, T: 'async_trait + BackgroundTask, 'life0: 'async_trait,

Implementors§