Builder

interface Builder

A builder for building a task.

This builder is designed to provide a more familiar way of scheduling tasks, using a more conventional delay and interval (period) system. It is designed to be simple and easy to use, at the cost of flexibility.

If you require greater flexibility over how the scheduler will execute your task, you should use Scheduler.submitTask.

Functions

Link copied to clipboard
open fun delay(duration: Duration): Task.Builder
abstract fun delay(time: TaskTime): Task.Builder
open fun delay(amount: Long, unit: TemporalUnit): Task.Builder

Sets the initial execution delay for the task.

Link copied to clipboard

Sets the execution type for the task.

Link copied to clipboard
open fun period(duration: Duration): Task.Builder
abstract fun period(time: TaskTime): Task.Builder
open fun period(amount: Long, unit: TemporalUnit): Task.Builder

Sets the delay between subsequent executions of the task.

Link copied to clipboard
abstract fun schedule(): Task

Requests for the scheduler to schedule this task for execution.