Skip to main content

EventQueueWriter

Trait EventQueueWriter 

Source
pub trait EventQueueWriter:
    Send
    + Sync
    + 'static {
    // Required methods
    fn write<'a>(
        &'a self,
        event: StreamResponse,
    ) -> Pin<Box<dyn Future<Output = A2aResult<()>> + Send + 'a>>;
    fn close<'a>(
        &'a self,
    ) -> Pin<Box<dyn Future<Output = A2aResult<()>> + Send + 'a>>;
}
Expand description

Trait for writing streaming events.

Object-safe; used as &dyn EventQueueWriter in the executor.

Required Methods§

Source

fn write<'a>( &'a self, event: StreamResponse, ) -> Pin<Box<dyn Future<Output = A2aResult<()>> + Send + 'a>>

Writes a streaming event to the queue.

§Errors

Returns an A2aError if the receiver has been dropped.

Source

fn close<'a>( &'a self, ) -> Pin<Box<dyn Future<Output = A2aResult<()>> + Send + 'a>>

Signals that no more events will be written.

§Errors

Returns an A2aError if closing fails.

Implementors§