- 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 TypeMethodDescriptionbooleancancel(boolean mayInterruptIfRunning) method that request to cancel generatorbooleanChecks 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:
trueif the generator has been cancelled,falseotherwise.
-
cancel
boolean cancel(boolean mayInterruptIfRunning) method that request to cancel generator
-