WindowTrigger

Trait WindowTrigger 

Source
pub trait WindowTrigger<W>: Send + Sync
where W: Clone + Debug + PartialEq + Eq + Hash,
{ // Required methods fn on_element( &mut self, timestamp: DateTime<Utc>, window: &W, ) -> TriggerResult; fn on_processing_time( &mut self, time: DateTime<Utc>, window: &W, ) -> TriggerResult; fn on_event_time( &mut self, watermark: DateTime<Utc>, window: &W, ) -> TriggerResult; fn clear(&mut self, window: &W); fn clone_trigger(&self) -> Box<dyn WindowTrigger<W>>; }
Expand description

Trait for window triggers that determine when to emit results.

Triggers are fired based on:

  • Element arrival
  • Processing time advance
  • Event time (watermark) advance

Required Methods§

Source

fn on_element(&mut self, timestamp: DateTime<Utc>, window: &W) -> TriggerResult

Called when an element is added to a window.

Source

fn on_processing_time( &mut self, time: DateTime<Utc>, window: &W, ) -> TriggerResult

Called when processing time advances.

Source

fn on_event_time( &mut self, watermark: DateTime<Utc>, window: &W, ) -> TriggerResult

Called when the watermark (event time) advances.

Source

fn clear(&mut self, window: &W)

Called when the trigger is cleared.

Source

fn clone_trigger(&self) -> Box<dyn WindowTrigger<W>>

Creates a clone of this trigger.

Implementors§