Class CompletionStageOrderedSubscriber<U,​D>

  • Type Parameters:
    U - published upstream elements
    D - mapped downstream values
    All Implemented Interfaces:
    org.reactivestreams.Subscriber<U>

    public class CompletionStageOrderedSubscriber<U,​D>
    extends CompletionStageSubscriber<U,​D>
    implements org.reactivestreams.Subscriber<U>
    This subscriber can be used to map between a Publisher of U elements and map them into CompletionStage of D promises, and it keeps them in the order the Publisher provided them.
    • Constructor Detail

      • CompletionStageOrderedSubscriber

        public CompletionStageOrderedSubscriber​(java.util.function.Function<U,​java.util.concurrent.CompletionStage<D>> mapper,
                                                org.reactivestreams.Subscriber<? super D> downstreamSubscriber)
    • Method Detail

      • whenNextFinished

        protected void whenNextFinished​(java.util.concurrent.CompletionStage<D> completionStage,
                                        D d,
                                        java.lang.Throwable throwable)
        Description copied from class: CompletionStageSubscriber
        This is called as each mapped CompletionStage completes with a value or exception
        Overrides:
        whenNextFinished in class CompletionStageSubscriber<U,​D>
        Parameters:
        completionStage - the completion stage that has completed
        d - the value completed
        throwable - or the throwable that happened during completion