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

public final Class BlockingMultiObserver<T>

extends CountDownLatch
implements SingleObserver<T>, CompletableObserver, MaybeObserver<T>
Class Inheritance
All Implemented Interfaces
io.reactivex.rxjava3.core.MaybeObserver, io.reactivex.rxjava3.core.CompletableObserver, io.reactivex.rxjava3.core.SingleObserver
Type Parameters
<T>
the value type
Imports
java.util.concurrent.*, io.reactivex.rxjava3.core.*, io.reactivex.rxjava3.disposables.Disposable, io.reactivex.rxjava3.exceptions.Exceptions, io.reactivex.rxjava3.functions.*, io.reactivex.rxjava3.internal.util.*, io.reactivex.rxjava3.plugins.RxJavaPlugins

A combined Observer that awaits the success or error signal via a CountDownLatch.

Field Summary

Modifier and TypeField and Description
pack-priv volatile boolean
pack-priv Throwable
pack-priv Disposable
pack-priv T

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the observer terminated in time, false otherwise
blockingAwait
(long
the timeout value
timeout
,
TimeUnit
the time unit
unit
)

Block until the observer terminates and return true; return false if the wait times out.

public void
blockingConsume(Consumer<? super T>
for a succeeding source
onSuccess
,
Consumer<? super Throwable>
for a failing source
onError
,
Action
for an empty source
onComplete
)

Blocks until the source completes and calls the appropriate callback.

public T

Returns:

the value received or null if no value received
blockingGet
()

Block until the latch is counted down then rethrow any exception received (wrapped if checked) or return the received value (null if none).

public T

Returns:

the value received or defaultValue if no value received
blockingGet
(T
the default value to return if no value was received
defaultValue
)

Block until the latch is counted down then rethrow any exception received (wrapped if checked) or return the received value (the defaultValue if none).

pack-priv void
public void
public void
public void
public void
onSuccess(T
the item emitted by the Single
value
)

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

Notifies the SingleObserver with a single item and that the Single has finished sending push-based notifications.
Inherited from java.util.concurrent.CountDownLatch:
awaitawaitcountDowngetCounttoString

Field Detail

cancelledback to summary
pack-priv volatile boolean cancelled
errorback to summary
pack-priv Throwable error
upstreamback to summary
pack-priv Disposable upstream
valueback to summary
pack-priv T value

Constructor Detail

BlockingMultiObserverback to summary
public BlockingMultiObserver()

Method Detail

blockingAwaitback to summary
public boolean blockingAwait(long timeout, TimeUnit unit)

Block until the observer terminates and return true; return false if the wait times out.

Parameters
timeout:long

the timeout value

unit:TimeUnit

the time unit

Returns:boolean

true if the observer terminated in time, false otherwise

blockingConsumeback to summary
public void blockingConsume(Consumer<? super T> onSuccess, Consumer<? super Throwable> onError, Action onComplete)

Blocks until the source completes and calls the appropriate callback.

Parameters
onSuccess:Consumer<? super T>

for a succeeding source

onError:Consumer<? super Throwable>

for a failing source

onComplete:Action

for an empty source

blockingGetback to summary
public T blockingGet()

Block until the latch is counted down then rethrow any exception received (wrapped if checked) or return the received value (null if none).

Returns:T

the value received or null if no value received

blockingGetback to summary
public T blockingGet(T defaultValue)

Block until the latch is counted down then rethrow any exception received (wrapped if checked) or return the received value (the defaultValue if none).

Parameters
defaultValue:T

the default value to return if no value was received

Returns:T

the value received or defaultValue if no value received

disposeback to summary
pack-priv void dispose()
onCompleteback to summary
public void onComplete()

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

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

Called once the deferred computation completes normally.

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

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

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

Notifies the SingleObserver with a single item and that the Single has finished sending push-based notifications.

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

Parameters
value:T

the item emitted by the Single

Annotations
@Override