public final class SafeCompletableSubscriber extends java.lang.Object implements CompletableSubscriber, Subscription
Constructor and Description |
---|
SafeCompletableSubscriber(CompletableSubscriber actual) |
Modifier and Type | Method and Description |
---|---|
boolean |
isUnsubscribed()
Indicates whether this
Subscription is currently unsubscribed. |
void |
onCompleted()
Called once the deferred computation completes normally.
|
void |
onError(java.lang.Throwable e)
Called once if the deferred computation 'throws' an exception.
|
void |
onSubscribe(Subscription d)
Called once by the Completable to set a Subscription on this instance which
then can be used to cancel the subscription at any time.
|
void |
unsubscribe()
Stops the receipt of notifications on the
Subscriber that was registered when this Subscription
was received. |
public SafeCompletableSubscriber(CompletableSubscriber actual)
public void onCompleted()
CompletableSubscriber
onCompleted
in interface CompletableSubscriber
public void onError(java.lang.Throwable e)
CompletableSubscriber
onError
in interface CompletableSubscriber
e
- the exception, not null.public void onSubscribe(Subscription d)
CompletableSubscriber
onSubscribe
in interface CompletableSubscriber
d
- the Subscription instance to call dispose on for cancellation, not nullpublic void unsubscribe()
Subscription
Subscriber
that was registered when this Subscription
was received.
This allows deregistering an Subscriber
before it has finished receiving all events (i.e. before
onCompleted is called).
unsubscribe
in interface Subscription
public boolean isUnsubscribed()
Subscription
Subscription
is currently unsubscribed.isUnsubscribed
in interface Subscription
true
if this Subscription
is currently unsubscribed, false
otherwise