Package org.infinispan.stream.impl
Interface ClusterStreamManager.RemoteIteratorPublisher<K>
-
- All Superinterfaces:
org.reactivestreams.Publisher<K>
- Enclosing interface:
- ClusterStreamManager<Original,K>
public static interface ClusterStreamManager.RemoteIteratorPublisher<K> extends org.reactivestreams.Publisher<K>
This producer is used to allow for it to provide additional signals to the subscribing caller. Callers may want to use the producer as a standard producer but also listen for the additional lost segment signal. This can be accomplished by doing the following:
Publisher<K> publisher = s -> remoteIteratorPublisher.subscribe(s, segments -> { // Do something};
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
subscribe(org.reactivestreams.Subscriber<? super K> s)
void
subscribe(org.reactivestreams.Subscriber<? super K> s, Consumer<? super Supplier<PrimitiveIterator.OfInt>> completedSegments, Consumer<? super Supplier<PrimitiveIterator.OfInt>> lostSegments)
Essentially the same asPublisher.subscribe(Subscriber)
except that aConsumer
is provided that will be invoked when a segment for a given request has been lost.
-
-
-
Method Detail
-
subscribe
void subscribe(org.reactivestreams.Subscriber<? super K> s, Consumer<? super Supplier<PrimitiveIterator.OfInt>> completedSegments, Consumer<? super Supplier<PrimitiveIterator.OfInt>> lostSegments)
Essentially the same asPublisher.subscribe(Subscriber)
except that aConsumer
is provided that will be invoked when a segment for a given request has been lost. This is to notify the subscribing code that they may have to rerequest such data.This publisher guarantees it will call the
Consumer
s beforeSubscriber.onComplete()
and it will not call them concurrently. The provided segments will always be non null, however it could be empty. However it is possible that a key returned could be mapped to a segment that was found to be suspected or completed.- Parameters:
s
- the subscriber to subscribecompletedSegments
- the consumer to be notified of completed segmentslostSegments
- the consumer to be notified of lost segments- See Also:
Publisher.subscribe(Subscriber)
-
-