T
- the value typepublic final class MaybeCallbackObserver<T> extends AtomicReference<Disposable> implements MaybeObserver<T>, Disposable, LambdaConsumerIntrospection
Constructor and Description |
---|
MaybeCallbackObserver(Consumer<? super T> onSuccess,
Consumer<? super Throwable> onError,
Action onComplete) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Dispose the resource, the operation should be idempotent.
|
boolean |
hasCustomOnError() |
boolean |
isDisposed()
Returns true if this resource has been disposed.
|
void |
onComplete()
Called once the deferred computation completes normally.
|
void |
onError(Throwable e)
Notifies the MaybeObserver that the
Maybe has experienced an error condition. |
void |
onSubscribe(Disposable d)
Provides the MaybeObserver with the means of cancelling (disposing) the
connection (channel) with the Maybe in both
synchronous (from within
onSubscribe(Disposable) itself) and asynchronous manner. |
void |
onSuccess(T value)
Notifies the MaybeObserver with one item and that the
Maybe has finished sending
push-based notifications. |
accumulateAndGet, compareAndSet, get, getAndAccumulate, getAndSet, getAndUpdate, lazySet, set, toString, updateAndGet, weakCompareAndSet
public void dispose()
Disposable
dispose
in interface Disposable
public boolean isDisposed()
Disposable
isDisposed
in interface Disposable
public void onSubscribe(Disposable d)
MaybeObserver
onSubscribe(Disposable)
itself) and asynchronous manner.onSubscribe
in interface MaybeObserver<T>
d
- the Disposable instance whose Disposable.dispose()
can
be called anytime to cancel the connectionpublic void onSuccess(T value)
MaybeObserver
Maybe
has finished sending
push-based notifications.
The Maybe
will not call this method if it calls MaybeObserver.onError(java.lang.Throwable)
.
onSuccess
in interface MaybeObserver<T>
value
- the item emitted by the Maybepublic void onError(Throwable e)
MaybeObserver
Maybe
has experienced an error condition.
If the Maybe
calls this method, it will not thereafter call MaybeObserver.onSuccess(T)
.
onError
in interface MaybeObserver<T>
e
- the exception encountered by the Maybepublic void onComplete()
MaybeObserver
onComplete
in interface MaybeObserver<T>
public boolean hasCustomOnError()
hasCustomOnError
in interface LambdaConsumerIntrospection
true
if a custom onError consumer implementation was supplied. Returns false
if the
implementation is missing an error consumer and thus using a throwing default implementation.Copyright © 2018 JBoss by Red Hat. All rights reserved.