ResultStore

Trait ResultStore 

Source
pub trait ResultStore: Send + Sync {
    // Required methods
    fn store_result<'life0, 'async_trait>(
        &'life0 self,
        task_id: TaskId,
        result: TaskResultValue,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_result<'life0, 'async_trait>(
        &'life0 self,
        task_id: TaskId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<TaskResultValue>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_state<'life0, 'async_trait>(
        &'life0 self,
        task_id: TaskId,
    ) -> Pin<Box<dyn Future<Output = Result<TaskState>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn forget<'life0, 'async_trait>(
        &'life0 self,
        task_id: TaskId,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn has_result<'life0, 'async_trait>(
        &'life0 self,
        task_id: TaskId,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Result store trait for AsyncResult API

This trait provides the storage interface needed by AsyncResult for querying task results in a Celery-compatible way. Implementations should provide lightweight result storage focused on result state and values.

Required Methods§

Source

fn store_result<'life0, 'async_trait>( &'life0 self, task_id: TaskId, result: TaskResultValue, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Store a task result

Source

fn get_result<'life0, 'async_trait>( &'life0 self, task_id: TaskId, ) -> Pin<Box<dyn Future<Output = Result<Option<TaskResultValue>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieve a task result

Source

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

Get task state

Source

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

Delete a task result

Source

fn has_result<'life0, 'async_trait>( &'life0 self, task_id: TaskId, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if a result exists

Implementors§