-
Notifications
You must be signed in to change notification settings - Fork 24
Async Library
The Async object contains the following functions.
start(action: function)
Starts running a task. action
should return an enumerator when called.
start(enumerator: object)
Starts running a task.
run(): bool
Runs some tasks. Returns false
if all tasks are completed.
runToCompletion()
Runs tasks until all are completed.
The Task object contains the following functions.
delay(seconds: number): object
Returns a task that will complete after seconds
seconds.
delay(seconds: number, cancellationToken: object)
Returns a task that will complete after seconds
seconds, or when cancellationToken
is canceled.
whenAll(...tasks: object): object
Returns a task that will complete after all of tasks
have completed.
whenAny(...tasks: object): object
Returns a task that will complete when at least one of tasks
has completed.