Skip to Main Content
Async JavaScript
book

Async JavaScript

by Trevor Burnham
November 2012
Intermediate to advanced content levelIntermediate to advanced
106 pages
2h 20m
English
Pragmatic Bookshelf
Content preview from Async JavaScript

Dynamic Async Queuing

Most of the time, the simple methods from the last two sections are enough to solve your async dilemmas. But async.series and async.parallel have their limitations.

  • The task array is static. Once you’ve called async.series or async.parallel, you can’t add or remove tasks.

  • There’s also no way to ask, “How many tasks have been completed?” It’s a black box, unless you dispatch updates from the tasks themselves.

  • You’re limited to either no concurrency or unlimited concurrency. That’s a pretty big deal when it comes to file I/O. If we’re operating on thousands of files, we don’t want to be inefficient by doing a series, but we’re likely to anger the OS if we try to do everything in parallel.

Async.js provides a versatile method ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modern Asynchronous JavaScript

Modern Asynchronous JavaScript

Faraz K. Kelhini
Learn TypeScript 3 by Building Web Applications

Learn TypeScript 3 by Building Web Applications

Sebastien Dubois, Alexis Georges

Publisher Resources

ISBN: 9781941222782Errata