public interface

Observer

io.reactivex.Observer<T>
Known Indirect Subclasses

Class Overview

Provides a mechanism for receiving push-based notifications.

After an Observer calls an Observable's subscribe method, first the Observable calls onSubscribe(Disposable) with a Disposable that allows cancelling the sequence at any time, then the Observable may call the Observer's onNext(T) method any number of times to provide notifications. A well-behaved Observable will call an Observer's onComplete() method exactly once or the Observer's onError(Throwable) method exactly once.

Summary

Public Methods
abstract void onComplete()
Notifies the Observer that the Observable has finished sending push-based notifications.
abstract void onError(Throwable e)
Notifies the Observer that the Observable has experienced an error condition.
abstract void onNext(T t)
Provides the Observer with a new item to observe.
abstract void onSubscribe(Disposable d)
Provides the Observer with the means of cancelling (disposing) the connection (channel) with the Observable in both synchronous (from within onNext(Object)) and asynchronous manner.

Public Methods

public abstract void onComplete ()

Notifies the Observer that the Observable has finished sending push-based notifications.

The Observable will not call this method if it calls onError(Throwable).

public abstract void onError (Throwable e)

Notifies the Observer that the Observable has experienced an error condition.

If the Observable calls this method, it will not thereafter call onNext(T) or onComplete().

Parameters
e the exception encountered by the Observable

public abstract void onNext (T t)

Provides the Observer with a new item to observe.

The Observable may call this method 0 or more times.

The Observable will not call this method again after it calls either onComplete() or onError(Throwable).

Parameters
t the item emitted by the Observable

public abstract void onSubscribe (Disposable d)

Provides the Observer with the means of cancelling (disposing) the connection (channel) with the Observable in both synchronous (from within onNext(Object)) and asynchronous manner.

Parameters
d the Disposable instance whose dispose() can be called anytime to cancel the connection