Class FlowableLastStageSubscriber<T>

java.lang.Object
java.util.concurrent.CompletableFuture<T>
io.reactivex.rxjava3.internal.jdk8.FlowableLastStageSubscriber<T>
Type Parameters:
T - the element type
All Implemented Interfaces:
FlowableSubscriber<T>, CompletionStage<T>, Future<T>, org.reactivestreams.Subscriber<T>

public final class FlowableLastStageSubscriber<T> extends CompletableFuture<T>
Signals the last element of the source via the underlying CompletableFuture, signals the a default item if the upstream is empty or signals NoSuchElementException.
Since:
3.0.0
  • Constructor Details

    • FlowableLastStageSubscriber

      public FlowableLastStageSubscriber(boolean hasDefault, T defaultItem)
  • Method Details

    • onNext

      public void onNext(T t)
    • onComplete

      public void onComplete()
    • afterSubscribe

      protected void afterSubscribe(org.reactivestreams.Subscription s)
    • onSubscribe

      public final void onSubscribe(@NonNull @NonNull org.reactivestreams.Subscription s)
      Description copied from interface: FlowableSubscriber
      Implementors of this method should make sure everything that needs to be visible in Subscriber.onNext(Object) is established before calling Subscription.request(long). In practice this means no initialization should happen after the request() call and additional behavior is thread safe in respect to onNext.
      Specified by:
      onSubscribe in interface FlowableSubscriber<T>
      Specified by:
      onSubscribe in interface org.reactivestreams.Subscriber<T>
    • onError

      public final void onError(Throwable t)
      Specified by:
      onError in interface org.reactivestreams.Subscriber<T>
    • cancelUpstream

      protected final void cancelUpstream()
    • clear

      protected final void clear()
    • cancel

      public final boolean cancel(boolean mayInterruptIfRunning)
      Specified by:
      cancel in interface Future<T>
      Overrides:
      cancel in class CompletableFuture<T>
    • complete

      public final boolean complete(T value)
      Overrides:
      complete in class CompletableFuture<T>
    • completeExceptionally

      public final boolean completeExceptionally(Throwable ex)
      Overrides:
      completeExceptionally in class CompletableFuture<T>