Search in sources :

Example 1 with EventFilter

use of io.mantisrx.connector.publish.core.EventFilter in project mantis by Netflix.

the class SourceSink method call.

@Override
public void call(Context context, PortRequest portRequest, Observable<String> observable) {
    observable = observable.filter(t1 -> !t1.isEmpty());
    ServerSentEventsSink<String> sink = new ServerSentEventsSink.Builder<String>().withEncoder(data -> data).withPredicate(new Predicate<>("description", new EventFilter(clientId))).withRequestPreprocessor(preProcessor).withRequestPostprocessor(postProcessor).build();
    observable.subscribe();
    sink.call(context, portRequest, observable);
}
Also used : Predicate(io.mantisrx.runtime.sink.predicate.Predicate) List(java.util.List) Func2(rx.functions.Func2) Sink(io.mantisrx.runtime.sink.Sink) Map(java.util.Map) PortRequest(io.mantisrx.runtime.PortRequest) EventFilter(io.mantisrx.connector.publish.core.EventFilter) ServerSentEventsSink(io.mantisrx.runtime.sink.ServerSentEventsSink) Context(io.mantisrx.runtime.Context) Observable(rx.Observable) ServerSentEventsSink(io.mantisrx.runtime.sink.ServerSentEventsSink) EventFilter(io.mantisrx.connector.publish.core.EventFilter) Predicate(io.mantisrx.runtime.sink.predicate.Predicate)

Aggregations

EventFilter (io.mantisrx.connector.publish.core.EventFilter)1 Context (io.mantisrx.runtime.Context)1 PortRequest (io.mantisrx.runtime.PortRequest)1 ServerSentEventsSink (io.mantisrx.runtime.sink.ServerSentEventsSink)1 Sink (io.mantisrx.runtime.sink.Sink)1 Predicate (io.mantisrx.runtime.sink.predicate.Predicate)1 List (java.util.List)1 Map (java.util.Map)1 Observable (rx.Observable)1 Func2 (rx.functions.Func2)1