Created
August 12, 2017 18:30
-
-
Save samccone/06996803da3eebc61c6ea72c12aed159 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function asyncSomething(server) { | |
return 'some_calculated_val' | |
} | |
taskList = [asyncSomething('a'), asyncSomething('b'), asyncSomething('b')] | |
taskFutures = tasks.awaitAllDone(taskList); | |
for (let result of taskFutures) { | |
try { | |
accum.push(result()); | |
} | |
catch (e) { | |
// a task failed | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment