Interface TaskCancellationToken


public interface TaskCancellationToken
Cancellation token visible to task handlers.

Implementations must be thread-safe. Cancellation is best-effort: a task handler must poll the token or use scheduler-specific interruption hooks to observe cancellation promptly.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns whether cancellation has been requested.
    Returns the task id.
  • Method Details

    • taskId

      TaskId taskId()
      Returns the task id.
      Returns:
      task id
    • cancellationRequested

      boolean cancellationRequested()
      Returns whether cancellation has been requested.
      Returns:
      cancellation flag