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

FilterMap Operator #298

Open Max-Meldrum opened 2 years ago

Max-Meldrum commented 2 years ago

An Operator that both filters and maps.

Akin to Rust's own FilterMap but on a Stream rather than Iterator.

let strings = ["1", "two", "NaN", "four", "5"];
let mut app = Application::default()
  .iterator(strings, |conf| {
     conf.set_arcon_time(ArconTime::Process);
  })
  .filter_map(|s| s.parse().ok())
  .build();