Package org.bsc.async

Interface AsyncGenerator.IsCancellable

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
    Modifier and Type
    Field
    Description
    static final Object
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    cancel(boolean mayInterruptIfRunning)
    method that request to cancel generator
    boolean
    Checks if the asynchronous generation has been cancelled.
  • Field Details

    • CANCELLED

      static final Object 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