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>
,java.util.concurrent.CompletionStage<T>
,java.util.concurrent.Future<T>
,org.reactivestreams.Subscriber<T>
- Direct Known Subclasses:
FlowableFirstStageSubscriber
,FlowableLastStageSubscriber
,FlowableSingleStageSubscriber
abstract class FlowableStageSubscriber<T> extends java.util.concurrent.CompletableFuture<T> implements FlowableSubscriber<T>
Base class that extends CompletableFuture and provides basic infrastructure to notify watchers upon upstream signals.- Since:
- 3.0.0
-
-
Constructor Summary
Constructors Constructor Description FlowableStageSubscriber()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
afterSubscribe(org.reactivestreams.Subscription s)
boolean
cancel(boolean mayInterruptIfRunning)
protected void
cancelUpstream()
protected void
clear()
boolean
complete(T value)
boolean
completeExceptionally(java.lang.Throwable ex)
void
onError(java.lang.Throwable t)
void
onSubscribe(@NonNull org.reactivestreams.Subscription s)
Implementors of this method should make sure everything that needs to be visible inSubscriber.onNext(Object)
is established before callingSubscription.request(long)
.-
Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, completeAsync, completeAsync, completedFuture, completedStage, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
-
-
-
-
Field Detail
-
upstream
final java.util.concurrent.atomic.AtomicReference<org.reactivestreams.Subscription> upstream
-
value
T value
-
-
Method Detail
-
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 inSubscriber.onNext(Object)
is established before callingSubscription.request(long)
. In practice this means no initialization should happen after therequest()
call and additional behavior is thread safe in respect toonNext
.- Specified by:
onSubscribe
in interfaceFlowableSubscriber<T>
- Specified by:
onSubscribe
in interfaceorg.reactivestreams.Subscriber<T>
-
afterSubscribe
protected abstract void afterSubscribe(org.reactivestreams.Subscription s)
-
onError
public final void onError(java.lang.Throwable t)
- Specified by:
onError
in interfaceorg.reactivestreams.Subscriber<T>
-
cancelUpstream
protected final void cancelUpstream()
-
clear
protected final void clear()
-
cancel
public final boolean cancel(boolean mayInterruptIfRunning)
-
complete
public final boolean complete(T value)
- Overrides:
complete
in classjava.util.concurrent.CompletableFuture<T>
-
completeExceptionally
public final boolean completeExceptionally(java.lang.Throwable ex)
- Overrides:
completeExceptionally
in classjava.util.concurrent.CompletableFuture<T>
-
-