quickRun

Turns dg into a task and runs it through scheduler. Starts the event loop automatically and will finish only when all tasks finish and no registered events remain (or theScheduler.shutdown is called).

Requires initScheduler to be already called before.

int
quickRun
(
scope int delegate
()
dg
)

Parameters

dg int delegate
()

delegate to run inside a task. Return value of the delegate will be propagated as the return value of quickRun itself, which can used as app exit status code.

Examples

int main ( )
{
    // Make sure the scheduler is initialized first, e.g.:
    // initScheduler(SchedulerConfiguration.init);

    return quickRun({
        // code that has to run inside task
        return 42;
    });
}

Meta