runOnce

Queue a task when the condition is met, debouncing the task from queueing more than once the condition is met.

This task will run, and a self-reset will not be propagated once the task is completed. Do note that this effectively nullifies the trigger for the task, as it cannot auto-reset unless the task is manually reset or designed to reset itself/run continuously. Managing the task passed here is up to the user.

This method can only be called once per ScheduledTask, see a TaskGroup for multiple task execution. If you do not mention timing control, this task will be run immediately when the condition is met, ending when the task ends.

Return

Current builder for additional task parameters

Parameters

task

The task to run.


Implicitly make a new RunTask to run once the condition is met, debouncing the task from queueing more than once the condition is met.

This code block will run, and a self-reset will not be propagated once the task is completed. Do note that this effectively nullifies the entire trigger for the task, as it cannot auto-reset. For a Runnable that can reset itself, consider passing a RunTask to the runOnce method which will grant you access to the task's reset method.

This method can only be called once per ScheduledTask, see a TaskGroup for multiple task execution. If you do not mention timing control, this task will be run immediately when the condition is met, ending immediately as it is an RunTask.

Return

Current builder for additional task parameters

Parameters

runnable

The code to run


Implicitly make a new RunTask to run once the condition is met, debouncing the task from queueing more than once the condition is met.

This code block will run, and a self-reset will not be propagated once the task is completed. Do note that this effectively nullifies the entire trigger for the task, as it cannot auto-reset. For a Runnable that can reset itself, consider passing a RunTask to the runOnce method which will grant you access to the task's reset method.

This method can only be called once per ScheduledTask, see a TaskGroup for multiple task execution. If you do not mention timing control, this task will be run immediately when the condition is met, ending immediately as it is an RunTask.

Return

Current builder for additional task parameters

Parameters

name

task name

runnable

The code to run