BackgroundQueue

clay.BackgroundQueue (Class)

An utility to enqueue functions and execute them in background, in a serialized way, meaning it is garanteed that no function in this queue will be run in parallel. An enqueued function will always be started after every previous function has finished executing.

Instance Members

checkInterval: Float

Time interval between each checks to see if there is something to run.


schedule(fn: Function): Void
Name Type
fn Function

destroy(): Void

new(?checkInterval: Float = 0.05): Void
Name Type Default
checkInterval Float 0.05

Private Members

runsInBackground: Bool

stop: Bool

pending: Array<Function>


internalRunInBackground(): Void