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
Name | Type | Default |
---|---|---|
checkInterval |
Float | 0.05 |
Private Members
runsInBackground: Bool
stop: Bool
pending: Array<Function>
mutex: sys.thread.Mutex
internalRunInBackground(): Void