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 TypeMethodDescriptionbooleanIndicates whether thisSubscriptionis currently unsubscribed.voidCalled once the deferred computation completes normally.voidCalled once if the deferred computation 'throws' an exception.voidCalled once by the Completable to set a Subscription on this instance which then can be used to cancel the subscription at any time.voidStops the receipt of notifications on theSubscriberthat 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.CompletableSubscriberCalled once the deferred computation completes normally.- Specified by:
onCompletedin interfaceCompletable.CompletableSubscriber
-
onError
Description copied from interface:Completable.CompletableSubscriberCalled once if the deferred computation 'throws' an exception.- Specified by:
onErrorin interfaceCompletable.CompletableSubscriber- Parameters:
e- the exception, not null.
-
onSubscribe
Description copied from interface:Completable.CompletableSubscriberCalled 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:
onSubscribein interfaceCompletable.CompletableSubscriber- Parameters:
d- the Subscription instance to call dispose on for cancellation, not null
-
unsubscribe
public void unsubscribe()Description copied from interface:SubscriptionStops the receipt of notifications on theSubscriberthat was registered when this Subscription was received.This allows unregistering an
Subscriberbefore it has finished receiving all events (i.e. before onCompleted is called).- Specified by:
unsubscribein interfaceSubscription
-
isUnsubscribed
public boolean isUnsubscribed()Description copied from interface:SubscriptionIndicates whether thisSubscriptionis currently unsubscribed.- Specified by:
isUnsubscribedin interfaceSubscription- Returns:
trueif thisSubscriptionis currently unsubscribed,falseotherwise
-