cda-group / arcon

State-first Streaming Applications in Rust
https://cda-group.github.io/arcon/
Apache License 2.0
175 stars 17 forks source link

Reusable Streams #302

Open Max-Meldrum opened 2 years ago

Max-Meldrum commented 2 years ago

Introduce capability of reusing Streams.

let mut app = Application::with_conf(conf);
let source_stream = app.iterator((0..1000000).map(|x| Event { id: x, data: 1.5 }), |conf| {
  conf.set_timestamp_extractor(|x: &Event| x.id);
});  
let s1 = source_stream.map(|x| x+ 10);
let s2 = source_stream.flatmap(|x| 0..x);