Skip to main content

Flow Control with Promises

Pure Code and JavaScript Continental 4
Average rating: ***..
(3.16, 19 ratings)

This is a sequel to my talk from last year, “The Promised Land.” I saw many developers tweet that they enjoyed the talk but found it a little basic. This talk will start with a 10-minute review on the basics of Promises, then go into a more advanced topic: how Promises can be used as an alternative to a flow control library like Async.js.

Async.js is one of the most popular libraries in the Node world (see the “Most Depended Upon” list at https://npmjs.org/). It allows people to do async iteration in a functional style, a la Underscore.js. But a Promise library like q, combined with a few clever techniques, can do just about anything that the much heavier Async.js can do. In this talk, we’ll see how: how to run an arbitrary array of async functions in series or in parallel; how to perform async collection operations like map; and more. We’ll look at both simplified code snippets and real examples from my connect-assets library.

This talk will be aimed primarily at Node.js developers. Although the same idioms and libraries could be used in the browser, in practice powerful async task management is rarely needed there.

Photo of Trevor Burnham

Trevor Burnham

HubSpot

Trevor Burnham is the author of the PragProg books “Async JavaScript” and “CoffeeScript: Accelerated JavaScript Development.” He works as a developer and tech evangelist for HubSpot in Cambridge, MA.

Sponsors

For exhibition and sponsorship opportunities at Fluent conference, contact Sharon Cordesse at (707) 827-7065 or scordesse@oreilly.com

Download the Fluent Sponsor/Exhibitor Prospectus

For information on trade opportunities with O'Reilly conferences contact Jaimey Walking Bear at mediapartners
@oreilly.com

View a complete list of Fluent 2013 contacts