A function that performs asynchronous work. This can either be work on another thread ("multi-threaded mode"), or it can represent a green thread ("single-threaded mode").

In single-threaded mode, the work function shouldn't complete the job all at once, as the main thread would lock up. Instead, it should perform a fraction of the job each time it's called. ThreadPool provides the function with a persistent State argument for tracking progress, which can be any object of your choice.

Caution: if using multi-threaded mode in HTML5, this must be a static function and binding arguments is forbidden. Compile with -Dlime-warn-portability to highlight functions that won't work.

Static methods

staticdispatch(self:Dynamic, args:Dynamic):Dynamic

Executes this function with the given arguments.