Skip to main content

DeferQueue

Trait DeferQueue 

Source
pub trait DeferQueue {
    // Required methods
    fn push<'life0, 'async_trait>(
        &'life0 mut self,
        input: InputMessage,
        message_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Box<dyn Error + Send + Sync>>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn drain<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(InputMessage, String)>, Box<dyn Error + Send + Sync>>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Where deferrable inputs wait while the thread cannot process them.

Required Methods§

Source

fn push<'life0, 'async_trait>( &'life0 mut self, input: InputMessage, message_id: String, ) -> Pin<Box<dyn Future<Output = Result<bool, Box<dyn Error + Send + Sync>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Hold back an input for later redelivery. Returns Ok(false) if this queue cannot defer, in which case the step processes the input immediately (interrupting any pending tool call).

Source

fn drain<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<(InputMessage, String)>, Box<dyn Error + Send + Sync>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Take back all deferred inputs. Called when the thread can process them (the pending tool call was answered or deliberately interrupted).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§