Interface SegmentAwarePublisher<R>

  • Type Parameters:
    R - value type
    All Superinterfaces:
    org.reactivestreams.Publisher<R>, SegmentCompletionPublisher<R>
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface SegmentAwarePublisher<R>
    extends SegmentCompletionPublisher<R>
    This is the same as SegmentCompletionPublisher except that it also allows listening for when a segment is lost. The lost segment provides the same notification guarantees as the segment completion of the parent interface.

    This interface is normally just for internal Infinispan usage as users shouldn't normally have to care about retrying.

    If segment completion is not needed, use the Publisher.subscribe(Subscriber) or provided SegmentCompletionPublisher.EMPTY_CONSUMER as the argument to both of the arguments in the subscribe(Subscriber, IntConsumer, IntConsumer) method. This allows implementors to optimize for the case when segment completion/loss is not needed as this may require additional overhead.

    • Method Detail

      • subscribe

        void subscribe​(org.reactivestreams.Subscriber<? super R> s,
                       IntConsumer completedSegmentConsumer,
                       IntConsumer lostSegmentConsumer)
        Same as SegmentCompletionPublisher.subscribe(Subscriber, IntConsumer), except that we also can notify a listener when a segment has been lost before publishing all its entries
        Parameters:
        s - subscriber to be notified of values and completion
        completedSegmentConsumer - segment notifier to notify
        lostSegmentConsumer - segment notifier to notify of lost segments
      • subscribe

        default void subscribe​(org.reactivestreams.Subscriber<? super R> s,
                               IntConsumer completedSegmentConsumer)
        Description copied from interface: SegmentCompletionPublisher
        Same as Publisher.subscribe(Subscriber), except that we also can notify a listener when a segment has published all of its entries
        Specified by:
        subscribe in interface SegmentCompletionPublisher<R>
        Parameters:
        s - subscriber to be notified of values and completion
        completedSegmentConsumer - segment notifier to notify