Skip to main content

loop

Description:

  Create a coroutine job that runs repeatedly until a condition is met.

Signature:

loop: function(routine: function(): boolean): Routine.Job

Parameters:

ParameterTypeDescription
routinefunctionA routine function to execute repeatedly until it returns non-nil or non-false.Yield or return true inside the routine function to stop the job execution.

Returns:

Return TypeDescription
Routine.JobA coroutine that runs the given routine function repeatedly.