public final class BiConsumerSingleObserver<T> extends AtomicReference<Disposable> implements SingleObserver<T>, Disposable
Constructor and Description |
---|
BiConsumerSingleObserver(BiConsumer<? super T,? super Throwable> onCallback) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Dispose the resource, the operation should be idempotent.
|
boolean |
isDisposed()
Returns true if this resource has been disposed.
|
void |
onError(Throwable e)
Notifies the SingleObserver that the
Single has experienced an error condition. |
void |
onSubscribe(Disposable d)
Provides the SingleObserver with the means of cancelling (disposing) the
connection (channel) with the Single in both
synchronous (from within
onSubscribe(Disposable) itself) and asynchronous manner. |
void |
onSuccess(T value)
Notifies the SingleObserver with a single item and that the
Single has finished sending
push-based notifications. |
accumulateAndGet, compareAndSet, get, getAndAccumulate, getAndSet, getAndUpdate, lazySet, set, toString, updateAndGet, weakCompareAndSet
public BiConsumerSingleObserver(BiConsumer<? super T,? super Throwable> onCallback)
public void onError(Throwable e)
SingleObserver
Single
has experienced an error condition.
If the Single
calls this method, it will not thereafter call SingleObserver.onSuccess(T)
.
onError
in interface SingleObserver<T>
e
- the exception encountered by the Singlepublic void onSubscribe(Disposable d)
SingleObserver
onSubscribe(Disposable)
itself) and asynchronous manner.onSubscribe
in interface SingleObserver<T>
d
- the Disposable instance whose Disposable.dispose()
can
be called anytime to cancel the connectionpublic void onSuccess(T value)
SingleObserver
Single
has finished sending
push-based notifications.
The Single
will not call this method if it calls SingleObserver.onError(java.lang.Throwable)
.
onSuccess
in interface SingleObserver<T>
value
- the item emitted by the Singlepublic void dispose()
Disposable
dispose
in interface Disposable
public boolean isDisposed()
Disposable
isDisposed
in interface Disposable
Copyright © 2019. All rights reserved.