An event loop implementation used for sys.thread.Thread

Constructor

new()

Methods

loop():Void

Execute all pending events. Wait and execute as many events as the number of times promise() was called. Runs until all repeating events are cancelled and no more events are expected.

Depending on a target platform this method may be non-reentrant. It must not be called from event callbacks.

progress():NextEventTime

Executes all pending events.

The returned time stamps can be used with Sys.time() for calculations.

Depending on a target platform this method may be non-reentrant. It must not be called from event callbacks.

promise():Void

Notify this loop about an upcoming event. This makes the thread stay alive and wait for as many events as the number of times .promise() was called. These events should be added via .runPromised().

run(event:() ‑> Void):Void

Execute event as soon as possible.

runPromised(event:() ‑> Void):Void

Add previously promised event for execution.