Module cScheduler

Schedule tasks to execute after a defined amount of time.

## About

## Changelog

1.04 - Dynamically add/detach idle notifier as the need arises

Functions

__init () Initialize the cScheduler class
on_idle () Perform idle task (check when it's time to execute a task)
add_task (ref, func, delay, ...) Add a new task to the scheduler
remove_task (ref) Remove a previously scheduled task
_execute_task (task) Execute a given task (using the provided context or anonymously)
cScheduledTask:__init (ref, func, delay, args) A class representing a scheduled task


Functions

__init ()
Initialize the cScheduler class
on_idle ()
Perform idle task (check when it's time to execute a task)
add_task (ref, func, delay, ...)
Add a new task to the scheduler

Parameters:

  • ref (Object) the object to use as context (optional)
  • func (func) the function to call
  • delay (number) the delay before executing task
  • ... (Vararg) variable number of extra arguments
remove_task (ref)
Remove a previously scheduled task

Parameters:

  • ref (cScheduledTask) reference to the task
_execute_task (task)
Execute a given task (using the provided context or anonymously)

Parameters:

  • task (cScheduledTask) reference to the task
cScheduledTask:__init (ref, func, delay, args)
A class representing a scheduled task

Parameters:

  • ref (Object) the object to use as context (optional)
  • func (func) the function to call
  • delay (number) the delay before executing task
  • args (table) variable number of extra arguments
generated by LDoc 1.4.2