run

open infix override fun run(task: () -> Unit): TaskHandle

Starts the conditional repeating task.

The task will run every period after an initial delay as long as Condition.canRun returns true. Once the condition fails, the task is automatically cancelled.

Return

a TaskHandle that can be used to manually cancel the task

Parameters

task

the block of code to execute