io.reactivex.ObservableEmitter<T> |
Abstraction over an RxJava Observer
that allows associating
a resource with it.
The onNext, onError and onComplete methods should be called
in a sequential manner, just like the Observer's methods.
Use serialize()
if you want to ensure this.
The other methods are thread-safe.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract boolean |
isDisposed()
Returns true if the downstream disposed the sequence.
| ||||||||||
abstract ObservableEmitter<T> |
serialize()
Ensures that calls to onNext, onError and onComplete are properly serialized.
| ||||||||||
abstract void |
setCancellable(Cancellable c)
Sets a Cancellable on this emitter; any previous Disposable
or Cancellation will be unsubscribed/cancelled.
| ||||||||||
abstract void |
setDisposable(Disposable d)
Sets a Disposable on this emitter; any previous Disposable
or Cancellation will be unsubscribed/cancelled.
| ||||||||||
abstract boolean |
tryOnError(Throwable t)
Attempts to emit the specified
Throwable error if the downstream
hasn't cancelled the sequence or is otherwise terminated, returning false
if the emission is not allowed to happen due to lifecycle restrictions. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Returns true if the downstream disposed the sequence.
Ensures that calls to onNext, onError and onComplete are properly serialized.
Sets a Cancellable on this emitter; any previous Disposable or Cancellation will be unsubscribed/cancelled.
c | the cancellable resource, null is allowed |
---|
Sets a Disposable on this emitter; any previous Disposable or Cancellation will be unsubscribed/cancelled.
d | the disposable, null is allowed |
---|
Attempts to emit the specified Throwable
error if the downstream
hasn't cancelled the sequence or is otherwise terminated, returning false
if the emission is not allowed to happen due to lifecycle restrictions.
Unlike onError(Throwable)
, the RxJavaPlugins.onError
is not called
if the error could not be delivered.
t | the throwable error to signal if possible |
---|