public abstract class BlockingBaseObserver<T> extends CountDownLatch implements Observer<T>, Disposable
Constructor and Description |
---|
BlockingBaseObserver() |
Modifier and Type | Method and Description |
---|---|
T |
blockingGet()
Block until the first value arrives and return it, otherwise
return null for an empty source and rethrow any exception.
|
void |
dispose()
Dispose the resource, the operation should be idempotent.
|
boolean |
isDisposed()
Returns true if this resource has been disposed.
|
void |
onComplete()
Notifies the Observer that the
Observable has finished sending push-based notifications. |
void |
onSubscribe(Disposable d)
Provides the Observer with the means of cancelling (disposing) the
connection (channel) with the Observable in both
synchronous (from within
Observer.onNext(Object) ) and asynchronous manner. |
await, await, countDown, getCount, toString
public final void onSubscribe(Disposable d)
Observer
Observer.onNext(Object)
) and asynchronous manner.onSubscribe
in interface Observer<T>
d
- the Disposable instance whose Disposable.dispose()
can
be called anytime to cancel the connectionpublic final void onComplete()
Observer
Observable
has finished sending push-based notifications.
The Observable
will not call this method if it calls Observer.onError(java.lang.Throwable)
.
onComplete
in interface Observer<T>
public final void dispose()
Disposable
dispose
in interface Disposable
public final boolean isDisposed()
Disposable
isDisposed
in interface Disposable
public final T blockingGet()
Copyright © 2019. All rights reserved.