Atom

task.group()

Runs a batch of functions concurrently.

Signature

task.group(functions[, limit])

Parameters

Array of transferable script functions callable with zero arguments, optional positive limit as for parallel.

Returns

Array of results in input order.

Behavior

Uses isolated workers. Cancels and drains started tasks on failure.

Errors

Invalid function, transfer or worker failure.

Example

Atom
use task
func first():
    return 3
func second():
    return 7
assert(task.group([first, second], 2)[1] == 7)