pub struct StreamPolicy { /* private fields */ }Expand description
Stream resequencing policy.
Uses a BTreeMap<u64, Exchange> as a priority queue keyed by sequence
number. Tracks next_expected and emits the contiguous run whenever the
expected sequence arrives. Gap timers fire when a missing sequence is not
received within gap_timeout.
Implementations§
Source§impl StreamPolicy
impl StreamPolicy
Sourcepub fn new_cyclic(
sequence_expr: Arc<dyn Expression>,
capacity: usize,
gap_timeout_ms: u64,
on_gap: GapPolicy,
on_capacity_exceeded: CapacityPolicy,
dedup: bool,
) -> Arc<Self> ⓘ
pub fn new_cyclic( sequence_expr: Arc<dyn Expression>, capacity: usize, gap_timeout_ms: u64, on_gap: GapPolicy, on_capacity_exceeded: CapacityPolicy, dedup: bool, ) -> Arc<Self> ⓘ
Create a new Arc<StreamPolicy> using Arc::new_cyclic.
Trait Implementations§
Source§impl ResequencePolicy for StreamPolicy
impl ResequencePolicy for StreamPolicy
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,
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,
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 set_timeout_tx(&self, tx: Sender<Exchange>)
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.Auto Trait Implementations§
impl !Freeze for StreamPolicy
impl !RefUnwindSafe for StreamPolicy
impl !UnwindSafe for StreamPolicy
impl Send for StreamPolicy
impl Sync for StreamPolicy
impl Unpin for StreamPolicy
impl UnsafeUnpin for StreamPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more