Stream windows
Window implementations for async streams:
- tumbling
- sliding
- periodic (requires a clock stream, emits window on every
tick)
Usage
Tumbling window
use WindowExt;
let stream = iter;
let window = stream.tumbling_window_unpin;
let res = window..await;
assert_eq!;
Sliding window
use WindowExt;
let stream = iter;
let window = stream.sliding_window_unpin;
let res = window..await;
assert_eq!
Periodic window
use WindowExt;
use stream;
use StreamExt;
use Duration;
use ;
use IntervalStream;
let clock_freq = from_millis;
let start = now + clock_freq;
let clock_stream = new;
let stream = stream! ;
let windows = stream.periodic_window_unpin..await;