Top Description Fields Constructors Methods
io.reactivex.rxjava3.internal.jdk8

public final Class CompletionStageConsumer<T>

extends CompletableFuture<T>
implements MaybeObserver<T>, SingleObserver<T>, CompletableObserver
Class Inheritance
All Implemented Interfaces
io.reactivex.rxjava3.core.CompletableObserver, io.reactivex.rxjava3.core.SingleObserver, io.reactivex.rxjava3.core.MaybeObserver
Type Parameters
<T>
the element type
Imports
java.util.NoSuchElementException, java.util.concurrent.CompletableFuture, java.util.concurrent.atomic.AtomicReference, io.reactivex.rxjava3.annotations.NonNull, io.reactivex.rxjava3.core.*, io.reactivex.rxjava3.disposables.Disposable, io.reactivex.rxjava3.internal.disposables.DisposableHelper, io.reactivex.rxjava3.plugins.RxJavaPlugins

Class that extends CompletableFuture and converts multiple types of reactive consumers and their signals into completion signals.
Since
3.0.0

Field Summary

Modifier and TypeField and Description
pack-priv final T
pack-priv final boolean
pack-priv final AtomicReference<Disposable>

Constructor Summary

AccessConstructor and Description
public
CompletionStageConsumer(boolean hasDefault, T defaultItem)

Method Summary

Modifier and TypeMethod and Description
public boolean
cancel(boolean
this value has no effect in this implementation because interrupts are not used to control processing.
mayInterruptIfRunning
)

Overrides java.util.concurrent.CompletableFuture.cancel.

Implements java.util.concurrent.Future.cancel.

If not already completed, completes this CompletableFuture with a CancellationException.
pack-priv void
pack-priv void
public boolean
complete(T
the result value
value
)

Overrides java.util.concurrent.CompletableFuture.complete.

If not already completed, sets the value returned by get() and related methods to the given value.
public boolean
completeExceptionally(Throwable
the exception
ex
)

Overrides java.util.concurrent.CompletableFuture.completeExceptionally.

If not already completed, causes invocations of get() and related methods to throw the given exception.
public void
public void
public void
public void
onSuccess(T
the item emitted by the Maybe
t
)

Implements io.reactivex.rxjava3.core.MaybeObserver.onSuccess, io.reactivex.rxjava3.core.SingleObserver.onSuccess.

Notifies the MaybeObserver with one item and that the Maybe has finished sending push-based notifications.
Inherited from java.util.concurrent.CompletableFuture:
acceptEitheracceptEitherAsyncacceptEitherAsyncallOfanyOfapplyToEitherapplyToEitherAsyncapplyToEitherAsynccompleteAsynccompleteAsynccompletedFuturecompletedStagecompleteOnTimeoutcopydefaultExecutordelayedExecutordelayedExecutorexceptionallyexceptionallyAsyncexceptionallyAsyncexceptionallyComposeexceptionallyComposeAsyncexceptionallyComposeAsyncexceptionNowfailedFuturefailedStagegetgetgetNowgetNumberOfDependentshandlehandleAsynchandleAsyncisCancelledisCompletedExceptionallyisDonejoinminimalCompletionStagenewIncompleteFutureobtrudeExceptionobtrudeValueorTimeoutresultNowrunAfterBothrunAfterBothAsyncrunAfterBothAsyncrunAfterEitherrunAfterEitherAsyncrunAfterEitherAsyncrunAsyncrunAsyncstatesupplyAsyncsupplyAsyncthenAcceptthenAcceptAsyncthenAcceptAsyncthenAcceptBoththenAcceptBothAsyncthenAcceptBothAsyncthenApplythenApplyAsyncthenApplyAsyncthenCombinethenCombineAsyncthenCombineAsyncthenComposethenComposeAsyncthenComposeAsyncthenRunthenRunAsyncthenRunAsynctoCompletableFuturetoStringwhenCompletewhenCompleteAsyncwhenCompleteAsync

Field Detail

defaultItemback to summary
pack-priv final T defaultItem
hasDefaultback to summary
pack-priv final boolean hasDefault
upstreamback to summary
pack-priv final AtomicReference<Disposable> upstream

Constructor Detail

CompletionStageConsumerback to summary
public CompletionStageConsumer(boolean hasDefault, T defaultItem)

Method Detail

cancelback to summary
public boolean cancel(boolean mayInterruptIfRunning)

Overrides java.util.concurrent.CompletableFuture.cancel.

Implements java.util.concurrent.Future.cancel.

Doc from java.util.concurrent.CompletableFuture.cancel.

If not already completed, completes this CompletableFuture with a CancellationException. Dependent CompletableFutures that have not already completed will also complete exceptionally, with a CompletionException caused by this CancellationException.

Parameters
mayInterruptIfRunning:boolean

this value has no effect in this implementation because interrupts are not used to control processing.

Returns:boolean

true if this task is now cancelled

Annotations
@Override
cancelUpstreamback to summary
pack-priv void cancelUpstream()
clearback to summary
pack-priv void clear()
completeback to summary
public boolean complete(T value)

Overrides java.util.concurrent.CompletableFuture.complete.

Doc from java.util.concurrent.CompletableFuture.complete.

If not already completed, sets the value returned by get() and related methods to the given value.

Parameters
value:T

the result value

Returns:boolean

true if this invocation caused this CompletableFuture to transition to a completed state, else false

Annotations
@Override
completeExceptionallyback to summary
public boolean completeExceptionally(Throwable ex)

Overrides java.util.concurrent.CompletableFuture.completeExceptionally.

Doc from java.util.concurrent.CompletableFuture.completeExceptionally.

If not already completed, causes invocations of get() and related methods to throw the given exception.

Parameters
ex:Throwable

the exception

Returns:boolean

true if this invocation caused this CompletableFuture to transition to a completed state, else false

Annotations
@Override
onCompleteback to summary
public void onComplete()

Implements io.reactivex.rxjava3.core.MaybeObserver.onComplete, io.reactivex.rxjava3.core.CompletableObserver.onComplete.

Doc from io.reactivex.rxjava3.core.MaybeObserver.onComplete.

Called once the deferred computation completes normally.

Annotations
@Override
onErrorback to summary
public void onError(Throwable t)
Annotations
@Override
onSubscribeback to summary
public void onSubscribe(@NonNull Disposable d)
Annotations
@Override
onSuccessback to summary
public void onSuccess(T t)

Implements io.reactivex.rxjava3.core.MaybeObserver.onSuccess, io.reactivex.rxjava3.core.SingleObserver.onSuccess.

Doc from io.reactivex.rxjava3.core.MaybeObserver.onSuccess.

Notifies the MaybeObserver with one item and that the Maybe has finished sending push-based notifications.

The Maybe will not call this method if it calls onError.

Parameters
t:T

the item emitted by the Maybe

Annotations
@Override