T
- the value type of the items emitted via Emitter.onNext(Object)
.public interface FlowableAsyncEmitter<T> extends Emitter<T>
Emitter
signals that allow
setting and replacing a Cancellable
resource to be cancelled
when the associated flow is cancelled.Modifier and Type | Method and Description |
---|---|
boolean |
isCancelled()
Returns true if the associated flow has been cancelled.
|
void |
onNothing()
The async logic may call this method to indicate the async
API invocation didn't produce any items but it hasn't ended
either, therefore, the generator can perform another
API invocation immediately.
|
boolean |
replaceCancellable(Cancellable c)
Sets the current
Cancellable resource to the provided one. |
boolean |
setCancellable(Cancellable c)
Sets the current
Cancellable resource to the provided one
and cancels the previous one if present. |
onComplete, onError, onNext
boolean setCancellable(Cancellable c)
Cancellable
resource to the provided one
and cancels the previous one if present.
If the underlying flow has been cancelled, the Cancellable provided will be cancelled immediately before returning false.
c
- the new Cancellable
to setboolean replaceCancellable(Cancellable c)
Cancellable
resource to the provided one.
If the underlying flow has been cancelled, the Cancellable
provided will be cancelled immediately before returning false.
Unlike setCancellable(Cancellable)
, the previous
Cancellable
is not cancelled when returning false.
c
- the new Cancellable
to setboolean isCancelled()
void onNothing()