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

Multiple Backends per Operator #253

Open Max-Meldrum opened 3 years ago

Max-Meldrum commented 3 years ago

This needs some further investigation, but could look something like this..

#[derive(ArconState)]
pub struct MyState<A: Backend, B: Backend> {
    other: EagerValue<SomeObject, A>,
    events: EagerValue<Event, B>
}

impl<A: Backend, B: Backend> StateConstructor for MyState<A, B> {
    type BackendType = (A, B);

    fn new(backend: Arc<Self::BackendType>) -> Self {
        Self {
            other: EagerValue::new("_other", backend.0),
            events: EagerValue::new("_events", backend.1),
        }
    }
}
// MyState<Rocks, Sled>