Skip to main content

ErasedTaskBroker

Trait ErasedTaskBroker 

Source
pub trait ErasedTaskBroker: Send + Sync {
    // Required methods
    fn submit_erased<'a>(
        &'a self,
        task: AgentTask,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'a>>;
    fn status_erased<'a>(
        &'a self,
        task_id: &'a str,
    ) -> Pin<Box<dyn Future<Output = Result<TaskStatus>> + Send + 'a>>;
    fn receive_erased(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AgentTask>>> + Send + '_>>;
    fn complete_erased<'a>(
        &'a self,
        task_id: &'a str,
        result: TaskResult,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
    fn fail_erased<'a>(
        &'a self,
        task_id: &'a str,
        error: String,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
}
Expand description

Object-safe wrapper for TaskBroker, enabling Arc<dyn ErasedTaskBroker>.

Required Methods§

Source

fn submit_erased<'a>( &'a self, task: AgentTask, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'a>>

Source

fn status_erased<'a>( &'a self, task_id: &'a str, ) -> Pin<Box<dyn Future<Output = Result<TaskStatus>> + Send + 'a>>

Source

fn receive_erased( &self, ) -> Pin<Box<dyn Future<Output = Result<Option<AgentTask>>> + Send + '_>>

Source

fn complete_erased<'a>( &'a self, task_id: &'a str, result: TaskResult, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>

Source

fn fail_erased<'a>( &'a self, task_id: &'a str, error: String, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>

Implementors§