Package rx.observers
Class SafeCompletableSubscriber
java.lang.Object
rx.observers.SafeCompletableSubscriber
- All Implemented Interfaces:
Completable.CompletableSubscriber
,Subscription
@Experimental
public final class SafeCompletableSubscriber
extends Object
implements Completable.CompletableSubscriber, Subscription
Wraps another CompletableSubscriber and handles exceptions thrown
from onError and onCompleted.
- Since:
- (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Completable.CompletableSubscriber
(package private) boolean
(package private) Subscription
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether thisSubscription
is currently unsubscribed.void
Called once the deferred computation completes normally.void
Called once if the deferred computation 'throws' an exception.void
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
Stops the receipt of notifications on theSubscriber
that was registered when this Subscription was received.
-
Field Details
-
actual
-
s
-
done
boolean done
-
-
Constructor Details
-
SafeCompletableSubscriber
-
-
Method Details
-
onCompleted
public void onCompleted()Description copied from interface:Completable.CompletableSubscriber
Called once the deferred computation completes normally.- Specified by:
onCompleted
in interfaceCompletable.CompletableSubscriber
-
onError
Description copied from interface:Completable.CompletableSubscriber
Called once if the deferred computation 'throws' an exception.- Specified by:
onError
in interfaceCompletable.CompletableSubscriber
- Parameters:
e
- the exception, not null.
-
onSubscribe
Description copied from interface:Completable.CompletableSubscriber
Called once by the Completable to set a Subscription on this instance which then can be used to cancel the subscription at any time.- Specified by:
onSubscribe
in interfaceCompletable.CompletableSubscriber
- Parameters:
d
- the Subscription instance to call dispose on for cancellation, not null
-
unsubscribe
public void unsubscribe()Description copied from interface:Subscription
Stops the receipt of notifications on theSubscriber
that was registered when this Subscription was received.This allows unregistering an
Subscriber
before it has finished receiving all events (i.e. before onCompleted is called).- Specified by:
unsubscribe
in interfaceSubscription
-
isUnsubscribed
public boolean isUnsubscribed()Description copied from interface:Subscription
Indicates whether thisSubscription
is currently unsubscribed.- Specified by:
isUnsubscribed
in interfaceSubscription
- Returns:
true
if thisSubscription
is currently unsubscribed,false
otherwise
-