public final class CallbackCompletableObserver extends AtomicReference<Disposable> implements CompletableObserver, Disposable, Consumer<Throwable>, LambdaConsumerIntrospection
Constructor and Description |
---|
CallbackCompletableObserver(Action onComplete) |
CallbackCompletableObserver(Consumer<? super Throwable> onError,
Action onComplete) |
Modifier and Type | Method and Description |
---|---|
void |
accept(Throwable e)
Consume the given value.
|
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)
Called once if the deferred computation 'throws' an exception.
|
void |
onSubscribe(Disposable d)
Called once by the Completable to set a Disposable on this instance which
then can be used to cancel the subscription at any time.
|
accumulateAndGet, compareAndSet, get, getAndAccumulate, getAndSet, getAndUpdate, lazySet, set, toString, updateAndGet, weakCompareAndSet
public CallbackCompletableObserver(Action onComplete)
public void accept(Throwable e)
Consumer
public void onComplete()
CompletableObserver
onComplete
in interface CompletableObserver
public void onError(Throwable e)
CompletableObserver
onError
in interface CompletableObserver
e
- the exception, not null.public void onSubscribe(Disposable d)
CompletableObserver
onSubscribe
in interface CompletableObserver
d
- the Disposable instance to call dispose on for cancellation, not nullpublic void dispose()
Disposable
dispose
in interface Disposable
public boolean isDisposed()
Disposable
isDisposed
in interface Disposable
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.