T
- the value type to emitpublic interface FlowableEmitter<T> extends Emitter<T>
Subscriber
that allows associating
a resource with it and exposes the current number of downstream
requested amount.
The onNext, onError and onComplete methods should be called
in a sequential manner, just like the Subscriber's methods.
Use serialize()
if you want to ensure this.
The other methods are thread-safe.
Modifier and Type | Method and Description |
---|---|
boolean |
isCancelled()
Returns true if the downstream cancelled the sequence.
|
long |
requested()
The current outstanding request amount.
|
FlowableEmitter<T> |
serialize()
Ensures that calls to onNext, onError and onComplete are properly serialized.
|
void |
setCancellable(Cancellable c)
Sets a Cancellable on this emitter; any previous Disposable
or Cancellation will be disposed/cancelled.
|
void |
setDisposable(Disposable s)
Sets a Disposable on this emitter; any previous Disposable
or Cancellation will be disposed/cancelled.
|
onComplete, onError, onNext
void setDisposable(@Nullable Disposable s)
s
- the disposable, null is allowedvoid setCancellable(@Nullable Cancellable c)
c
- the cancellable resource, null is allowedlong requested()
This method is thread-safe.
boolean isCancelled()
This method is thread-safe.
@NonNull FlowableEmitter<T> serialize()