akka / akka-edge-rs

Akka Edge support in Rust
https://doc.akka.io/docs/akka-edge/current/
Other
9 stars 1 forks source link

Support for initial filters #34

Closed huntc closed 1 year ago

huntc commented 1 year ago

Filters that can be conveyed to a remote producer on initialising a connection, can now be provided.

One difference from its JVM counterpart is that filters are declared generally for projections here. In the JVM, filters are specific to the gRPC package. I felt that we might also use these filters for other transports, such as SSE.

Sample usage of declaring an initial filter during construction of a source provider:

        let channel = Channel::from_static("http://127.0.0.1:50051");
        let mut source_provider = GrpcSourceProvider::<u32, _>::new(
            || channel.connect(),
            StreamId::from("some-string-id"),
            offset_store,
        )
        .with_initial_consumer_filter(vec![FilterCriteria::IncludeEntityIds {
            entity_id_offsets: vec![EntityIdOffset {
                entity_id: entity_id.clone(),
                seq_nr: 0,
            }],
        }]);