RxJava



rx.operators
Class SafeObserver<T>

java.lang.Object
  extended by rx.operators.SafeObserver<T>
Type Parameters:
T -
All Implemented Interfaces:
Observer<T>

Deprecated. replaced by SafeSubscriber

@Deprecated
public class SafeObserver<T>
extends java.lang.Object
implements Observer<T>

Wrapper around Observer to ensure compliance with Rx contract.

The following is taken from the Rx Design Guidelines document:

 Messages sent to instances of the IObserver interface follow the following grammar:
 
 OnNext* (OnCompleted | OnError)?
 
 This grammar allows observable sequences to send any amount (0 or more) of OnNext messages to the subscribed
 observer instance, optionally followed by a single success (OnCompleted) or failure (OnError) message.
 
 The single message indicating that an observable sequence has finished ensures that consumers of the
 observable sequence can deterministically establish that it is safe to perform cleanup operations.
 
 A single failure further ensures that abort semantics can be maintained for operators that work on
 multiple observable sequences (see paragraph 6.6).
 

This wrapper will do the following:

It will not synchronize onNext execution. Use the SerializedObserver to do that.


Constructor Summary
SafeObserver(Observer<? super T> actual)
          Deprecated.  
SafeObserver(SafeObservableSubscription subscription, Observer<? super T> actual)
          Deprecated.  
 
Method Summary
protected  void _onError(java.lang.Throwable e)
          Deprecated.  
 void onCompleted()
          Deprecated. Notifies the Observer that the Observable has finished sending push-based notifications.
 void onError(java.lang.Throwable e)
          Deprecated. Notifies the Observer that the Observable has experienced an error condition.
 void onNext(T args)
          Deprecated. Provides the Observer with new data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SafeObserver

public SafeObserver(Observer<? super T> actual)
Deprecated. 

SafeObserver

public SafeObserver(SafeObservableSubscription subscription,
                    Observer<? super T> actual)
Deprecated. 
Method Detail

onCompleted

public void onCompleted()
Deprecated. 
Description copied from interface: Observer
Notifies the Observer that the Observable has finished sending push-based notifications.

The Observable will not call this closure if it calls onError.

Specified by:
onCompleted in interface Observer<T>

onError

public void onError(java.lang.Throwable e)
Deprecated. 
Description copied from interface: Observer
Notifies the Observer that the Observable has experienced an error condition.

If the Observable calls this closure, it will not thereafter call onNext or onCompleted.

Specified by:
onError in interface Observer<T>

onNext

public void onNext(T args)
Deprecated. 
Description copied from interface: Observer
Provides the Observer with new data.

The Observable calls this closure 1 or more times, unless it calls onError in which case this closure may never be called.

The Observable will not call this closure again after it calls either onCompleted or onError.

Specified by:
onNext in interface Observer<T>

_onError

protected void _onError(java.lang.Throwable e)
Deprecated.