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 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 as Publisher.subscribe(Subscriber) except that a Consumer 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 Consumers before Subscriber.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 subscribe
        completedSegments - the consumer to be notified of completed segments
        lostSegments - the consumer to be notified of lost segments
        See Also:
        Publisher.subscribe(Subscriber)
      • subscribe

        default void subscribe​(org.reactivestreams.Subscriber<? super K> s)
        Specified by:
        subscribe in interface org.reactivestreams.Publisher<K>