- All Known Subinterfaces:
AsyncGenerator.Cancellable<E>
- All Known Implementing Classes:
AsyncGenerator.BaseCancellable
,AsyncGenerator.WithEmbed
,AsyncGenerator.WithResult
,AsyncGeneratorQueue.Generator
,GeneratorSubscriber
- Enclosing interface:
- AsyncGenerator<E>
public static interface AsyncGenerator.IsCancellable
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel
(boolean mayInterruptIfRunning) method that request to cancel generatorboolean
Checks if the asynchronous generation has been cancelled.
-
Field Details
-
CANCELLED
-
-
Method Details
-
isCancelled
boolean isCancelled()Checks if the asynchronous generation has been cancelled.The default implementation always returns
false
. Implementations that support cancellation should override this method.- Returns:
true
if the generator has been cancelled,false
otherwise.
-
cancel
boolean cancel(boolean mayInterruptIfRunning) method that request to cancel generator
-