File builtin/edt.lua

edt.lua - Event Dispatch Thread Provides utilities for scheduling operations on the main thread.

Functions

addEvent (event) Adds a one-time event to the event queue
addTask (task) Adds a function to the active task list.
getEventThread (mainThread) Returns the thread events must be called on
removeEvents (event) Removes all copies of event from the event queue
removeTasks (task) Removes all instances of task from the tasks list.
update () Should be called by the system once every frame.


Functions

addEvent (event)
Adds a one-time event to the event queue

Parameters:

  • event: The event function to enqueue
addTask (task)
Adds a function to the active task list. Tasks get called once each frame.

Parameters:

  • task: The task function to add
getEventThread (mainThread)
Returns the thread events must be called on

Parameters:

  • mainThread:
removeEvents (event)
Removes all copies of event from the event queue

Parameters:

  • event: The event function to remove
removeTasks (task)
Removes all instances of task from the tasks list.

Parameters:

  • task: The task function to remove
update ()
Should be called by the system once every frame. Runs tasks and events on the main thread.

Valid XHTML 1.0!