Task

interface Task

A task that can be scheduled by the scheduler.

The task has three states:

  • Alive: The task is available for scheduling.

  • Paused: The task is not available for scheduling, but can be made available with resume.

  • Cancelled: The task is not available for scheduling, and cannot be made available.

Types

Link copied to clipboard
interface Builder

A builder for building a task.

Functions

Link copied to clipboard
abstract fun cancel()

Cancels this task, with immediate effect.

Link copied to clipboard
abstract fun isAlive(): Boolean

Checks if this task is alive, meaning it is not cancelled, and is available for scheduling or currently being scheduled.

Link copied to clipboard
abstract fun isPaused(): Boolean

Checks if this task is currently paused, meaning it will not be executed by the scheduler.

Link copied to clipboard
abstract fun resume()

Resumes this task if it was paused, meaning it can be executed by the scheduler again.

Properties

Link copied to clipboard

Indicates how this task will be executed by the scheduler.