Interface AsyncGeneratorFlow.Dispatcher<E>
- All Superinterfaces:
AsyncGenerator.IsCancellable, AsyncGeneratorFlow.IsCancellableEx
- Enclosing interface:
AsyncGeneratorFlow
-
Nested Class Summary
Nested classes/interfaces inherited from interface AsyncGeneratorFlow.IsCancellableEx
AsyncGeneratorFlow.IsCancellableEx.Listener, AsyncGeneratorFlow.IsCancellableEx.Registration -
Field Summary
Fields inherited from interface AsyncGenerator.IsCancellable
CANCELLED -
Method Summary
Modifier and TypeMethodDescriptiondefault booleancancel(boolean mayInterruptIfRunning) method that request to cancel generatorvoiddispatchAsync(AsyncGenerator.Data<E> data) voiddispatchSync(AsyncGenerator.Data<E> data) default booleanChecks if the asynchronous generation has been cancelled.Calls the listener right away if already cancelled.
-
Method Details
-
dispatchSync
- Throws:
InterruptedException
-
dispatchAsync
-
onCancel
default AsyncGeneratorFlow.IsCancellableEx.Registration onCancel(AsyncGeneratorFlow.IsCancellableEx.Listener listener) Description copied from interface:AsyncGeneratorFlow.IsCancellableExCalls the listener right away if already cancelled.- Specified by:
onCancelin interfaceAsyncGeneratorFlow.IsCancellableEx
-
isCancelled
default boolean isCancelled()Description copied from interface:AsyncGenerator.IsCancellableChecks if the asynchronous generation has been cancelled.The default implementation always returns
false. Implementations that support cancellation should override this method.- Specified by:
isCancelledin interfaceAsyncGenerator.IsCancellable- Returns:
trueif the generator has been cancelled,falseotherwise.
-
cancel
default boolean cancel(boolean mayInterruptIfRunning) Description copied from interface:AsyncGenerator.IsCancellablemethod that request to cancel generator- Specified by:
cancelin interfaceAsyncGenerator.IsCancellable
-