java.lang.Object | |
↳ | io.reactivex.observers.SafeObserver<T> |
Wraps another Subscriber and ensures all onXXX methods conform the protocol (except the requirement for serialized access).
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SafeObserver(Observer<? super T> actual)
Constructs a SafeObserver by wrapping the given actual Observer.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
dispose()
Dispose the resource, the operation should be idempotent.
| ||||||||||
boolean |
isDisposed()
Returns true if this resource has been disposed.
| ||||||||||
void |
onComplete()
Notifies the Observer that the
Observable has finished sending push-based notifications. | ||||||||||
void |
onError(Throwable t)
Notifies the Observer that the
Observable has experienced an error condition. | ||||||||||
void |
onNext(T t)
Provides the Observer with a new item to observe.
| ||||||||||
void |
onSubscribe(Disposable s)
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. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
io.reactivex.Observer
| |||||||||||
From interface
io.reactivex.disposables.Disposable
|
Constructs a SafeObserver by wrapping the given actual Observer.
actual | the actual Observer to wrap, not null (not validated) |
---|
Dispose the resource, the operation should be idempotent.
Returns true if this resource has been disposed.
Notifies the Observer that the Observable
has finished sending push-based notifications.
The Observable
will not call this method if it calls onError(Throwable)
.
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()
.
t | the exception encountered by the Observable |
---|
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)
.
t | the item emitted by the Observable |
---|
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.
s | the Disposable instance whose dispose() can
be called anytime to cancel the connection |
---|