Package hu.akarnokd.rxjava3.operators
Interface FlowableAsyncEmitter<T>
-
- Type Parameters:
T- the value type of the items emitted viaEmitter.onNext(Object).
- All Superinterfaces:
Emitter<T>
public interface FlowableAsyncEmitter<T> extends Emitter<T>
Provides an API on top of theEmittersignals that allow setting and replacing aCancellableresource to be cancelled when the associated flow is cancelled.- Since:
- 2.1.11 - experimental
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisCancelled()Returns true if the associated flow has been cancelled.voidonNothing()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.booleanreplaceCancellable(Cancellable c)Sets the currentCancellableresource to the provided one.booleansetCancellable(Cancellable c)Sets the currentCancellableresource to the provided one and cancels the previous one if present.-
Methods inherited from interface io.reactivex.rxjava3.core.Emitter
onComplete, onError, onNext
-
-
-
-
Method Detail
-
setCancellable
boolean setCancellable(Cancellable c)
Sets the currentCancellableresource 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.
- Parameters:
c- the newCancellableto set- Returns:
- if true, the operation was successful, if false, the associated flow has been cancelled
-
replaceCancellable
boolean replaceCancellable(Cancellable c)
Sets the currentCancellableresource to the provided one.If the underlying flow has been cancelled, the
Cancellableprovided will be cancelled immediately before returning false.Unlike
setCancellable(Cancellable), the previousCancellableis not cancelled when returning false.- Parameters:
c- the newCancellableto set- Returns:
- if true, the operation was successful, if false, the associated flow has been cancelled
-
isCancelled
boolean isCancelled()
Returns true if the associated flow has been cancelled.- Returns:
- true if the associated flow has been cancelled
-
onNothing
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.
-
-