Class FlowableStageSubscriber<T>

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

abstract class FlowableStageSubscriber<T> extends CompletableFuture<T> implements FlowableSubscriber<T>
Base class that extends CompletableFuture and provides basic infrastructure to notify watchers upon upstream signals.
Since:
3.0.0
  • Field Details

    • upstream

      final AtomicReference<org.reactivestreams.Subscription> upstream
    • value

      T value
  • Constructor Details

    • FlowableStageSubscriber

      FlowableStageSubscriber()
  • Method Details

    • 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>
    • afterSubscribe

      protected abstract void afterSubscribe(org.reactivestreams.Subscription s)
    • 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>