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 CountDownLatch
implements FlowableSubscriber<T>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal TBlock until the first value arrives and return it, otherwise return null for an empty source and rethrow any exception.final voidfinal voidonSubscribe(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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.reactivestreams.Subscriber
onError, onNext
-
Field Details
-
Constructor Details
-
BlockingBaseSubscriber
public BlockingBaseSubscriber()
-
-
Method Details
-
onSubscribe
public final void onSubscribe(org.reactivestreams.Subscription s) Description copied from interface:FlowableSubscriberImplementors 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:
onSubscribein interfaceFlowableSubscriber<T>- Specified by:
onSubscribein interfaceorg.reactivestreams.Subscriber<T>
-
onComplete
public final void onComplete()- Specified by:
onCompletein interfaceorg.reactivestreams.Subscriber<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
-