Skip to main content

ResequencePolicy

Trait ResequencePolicy 

Source
pub trait ResequencePolicy:
    Send
    + Sync
    + 'static {
    // Required methods
    fn accept<'life0, 'async_trait>(
        &'life0 self,
        input: Exchange,
    ) -> Pin<Box<dyn Future<Output = Vec<Exchange>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn flush<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<Exchange>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn name(&self) -> &'static str;

    // Provided method
    fn set_timeout_tx(&self, _tx: Sender<Exchange>) { ... }
}
Expand description

Buffer / ordering policy for a resequencer.

Implementations (batch, stream) live in sibling modules.

Required Methods§

Source

fn accept<'life0, 'async_trait>( &'life0 self, input: Exchange, ) -> Pin<Box<dyn Future<Output = Vec<Exchange>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Accept an input; return the list of now-ready exchanges (in emit order).

Source

fn flush<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<Exchange>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Flush all buffered state (shutdown). Return any remaining, ordered.

Source

fn name(&self) -> &'static str

Stable name for logging / diagnostics.

Provided Methods§

Source

fn set_timeout_tx(&self, _tx: Sender<Exchange>)

Set the driver channel for timeout-triggered emissions. Default is a no-op. BatchPolicy overrides this to receive the channel that feeds the post-driver.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§