Trait AsyncFunctionHandler

Source
pub trait AsyncFunctionHandler: Send + Sync {
    // Required method
    fn execute<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        message: &'life1 mut Message,
        input: &'life2 Value,
    ) -> Pin<Box<dyn Future<Output = Result<(usize, Vec<Change>)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Async interface for task functions that operate on messages

This trait defines how async task functions process a message with given input parameters. It is particularly useful for IO-bound operations like HTTP requests, file operations, and database queries.

Required Methods§

Source

fn execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, message: &'life1 mut Message, input: &'life2 Value, ) -> Pin<Box<dyn Future<Output = Result<(usize, Vec<Change>)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Execute the function asynchronously on a message with input parameters

§Arguments
  • message - The message to process
  • input - Function input parameters
§Returns
  • Result<(usize, Vec<Change>)> - Result containing status code and changes, or error

Implementors§