Interface Observer<T>
- Type Parameters:
T
- the type of item the Observer expects to observe
public interface Observer<T>
Provides a mechanism for receiving push-based notifications.
After an Observer calls
subscribe
or
subscribe
method, the Connector
calls the Observer's onNext(T)
method to provide notifications. The Connector
should call an
Observer's onCompleted()
or onError(java.lang.Throwable)
method exactly once.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Notifies the Observer that theConnector
has finished sending push-based notifications.void
Notifies the Observer that theConnector
has experienced an error condition.void
Provides the Observer with a new item to observe.
-
Method Details
-
onCompleted
void onCompleted()Notifies the Observer that theConnector
has finished sending push-based notifications.The
Connector
will not call this method if it callsonError(java.lang.Throwable)
. -
onError
Notifies the Observer that theConnector
has experienced an error condition.If the
Connector
calls this method, it will not thereafter callonNext(T)
oronCompleted()
.- Parameters:
e
- the exception encountered by theConnector
-
onNext
Provides the Observer with a new item to observe.The
Connector
may call this method 0 or more times.The
Connector
will not call this method again after it calls eitheronCompleted()
oronError(java.lang.Throwable)
.- Parameters:
t
- the item emitted by theConnector
-