View source
abstract WorkFunction<T>(T)
package lime.system
from T to T
import lime.system.WorkOutput
Available on all platforms
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.