startLoop

open fun startLoop(@NonNull name: String, @NonNull loopSleepDuration: Measure<Time>, @NonNull task: Runnable)

Start a new thread with the given infinite loop task. This thread will auto end when the task is interrupted.

Parameters

name

the name of the thread to access it later and to log as

loopSleepDuration

the duration to sleep this thread after every loop to save resources

task

the infinite loop task to run on the new thread


open fun startLoop(@NonNull name: String, @NonNull task: Runnable)

Start a new thread with the given infinite loop task. This thread will auto end when the task is interrupted.

Parameters

name

the name of the thread to access it later and to log as

task

the infinite loop task to run on the new thread


open fun startLoop(@NonNull loopSleepDuration: Measure<Time>, @NonNull task: Runnable)

Start a new thread with the given infinite loop task. This thread will auto end when the task is interrupted, with a name defined by the class of the Runnable.

Parameters

loopSleepDuration

the duration to sleep this thread after every loop to save resources

task

the infinite loop task to run on the new thread


open fun startLoop(@NonNull task: Runnable)

Start a new thread with the given infinite loop task. This thread will auto end when the task is interrupted, with a name defined by the class of the Runnable.

Parameters

task

the infinite loop task to run on the new thread