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

Application improvements #318

Closed Max-Meldrum closed 2 years ago

Max-Meldrum commented 2 years ago

This PR contains a bunch of improvements regarding the creation of an Arcon application.

Removes:

Introduces:

You no longer create streams from an Application struct. Users can convert types that implement ToStreamExt into a Stream<T> type and then later turn it into a sink type.

Using app macro

#[arcon::app(name = "example")]
fn main() {
    (0..10u64)
        .to_stream(|conf| conf.set_arcon_time(ArconTime::Process))
        .filter(|x| *x > 50)
        .map(|x| x * 10)
        .print()
}

Without app macro

let mut builder: ApplicationBuilder = (0..10u64)
     .to_stream(|conf| conf.set_arcon_time(ArconTime::Process))
     .filter(|x| *x > 50)
     .map(|x| x * 10)
     .print()
     .builder();

let mut app: Application = builder
   .name("example")
   .build();

app.run_and_block();