Class BlockingBaseSubscriber<T>
- java.lang.Object
-
- java.util.concurrent.CountDownLatch
-
- io.reactivex.rxjava3.internal.subscribers.BlockingBaseSubscriber<T>
-
- All Implemented Interfaces:
FlowableSubscriber<T>
,org.reactivestreams.Subscriber<T>
- Direct Known Subclasses:
BlockingFirstSubscriber
,BlockingLastSubscriber
public abstract class BlockingBaseSubscriber<T> extends java.util.concurrent.CountDownLatch implements FlowableSubscriber<T>
-
-
Constructor Summary
Constructors Constructor Description BlockingBaseSubscriber()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
blockingGet()
Block until the first value arrives and return it, otherwise return null for an empty source and rethrow any exception.void
onComplete()
void
onSubscribe(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.CountDownLatch
await, await, countDown, getCount, toString
-
-
-
-
Field Detail
-
value
T value
-
error
java.lang.Throwable error
-
upstream
org.reactivestreams.Subscription upstream
-
cancelled
volatile boolean cancelled
-
-
Method Detail
-
onSubscribe
public final void onSubscribe(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>
-
onComplete
public final void onComplete()
- Specified by:
onComplete
in interfaceorg.reactivestreams.Subscriber<T>
-
blockingGet
public final T blockingGet()
Block until the first value arrives and return it, otherwise return null for an empty source and rethrow any exception.- Returns:
- the first value or null if the source is empty
-
-