Web Directions

Conffab

  • Speakers
  • Presentations
  • Conferences
  • Organizers
  • Topics
  • Pricing & Plans
  • Browse
  • Signup
  • Sign In
  • Speakers
  • Presentations
  • Conferences
  • Organizers
  • Topics
  • Pricing & Plans
  • Browse
  • Signup
  • Sign In
Advanced Search
Searching videos

Async Frontiers in JavaScript

Domenic Denicola at Code 2015
  • JavaScript
Sign up for Conffab Free to watch this and hundreds of other videos for free
  • Details
  • Keypoints

Slowly but surely, promises have spread throughout the JavaScript ecosystem, standardized by ES 2015 and embraced by the web platform. But the world of asynchronous programming contains more patterns than the simple single-valued async function call that promises represent. What about things like streams, observables, async iterators—or even just cancelable promises? How do they fit, both in the conceptual landscape and in your day-to-day programming?

For the last year, Domenic has been working to bring an implementation of I/O streams to the browser. Meanwhile, designs for a cancelable promise type (sometimes called “tasks”) are starting to form, driven by the needs of web platform APIs. And TC39 has several proposals floating around for more general asynchronous iteration. We’ll learn about these efforts and more, as Domenic guides us through the frontiers of popular libraries, language design, and web standards.

Usual thing is the four quadrant sync/asyc singular/plural. But this is such a gross over-simplification it’s not really useful.

Two axes of interestingness:

  • asynchronicity
  • pluralness

Promises represent the eventual result of an asynchronous action, but they are not a representation of the action itself.

Promises are multi-consumer; but consumers can’t cancel the action.

Cancellable promises (“tasks”), appearing in fetch first. Promise subclass where consumers can request cancellation, while still allowing branching etc.

Also adding finally() to all promises (then/catch/finally). Finally always happens where then and catch may not.

Plural+Async… I/O streams, directory listings, sensor readings, events in general… this combination is actually pretty common.

(Extremely concept-dense talk so get into the slides. Lots of good detail on the design decisions that go into writing specs; including the evergreen “how to name it” problem and how to deal with the different points of view… eg. the python mindset vs the C mindset on the committee.)

Lots of inspiration: https://github.com/kriskowal/gtor

Is all this urgent? Mostly not. Streams are pretty urgent so they are working on that as fast as they can go; but many other considerations are interesting and potentially useful but we have usable options in the meantime.

You may also be interested in

Thumbnail for Zen of JavaScript

Zen of JavaScript

Dmitry Baranovskiy

Thumbnail for The State of Front-End Testing

The State of Front-End Testing

Alicia Sedlock

Thumbnail for Installable Web Apps with Web Apps Manifests

Installable Web Apps with Web Apps Manifests

Elise Chant

Thumbnail for The Things You Can’t Do

The Things You Can’t Do

Rob Howard

Thumbnail for The Two Pillars of JavaScript

The Two Pillars of JavaScript

Eric Elliott

Thumbnail for JavaScript Numbers Like You’ve Never Seen Them Before

JavaScript Numbers Like You’ve Never Seen Them Before

Alex Mackey

Thumbnail for Eliminate JavaScript Code Smells

Eliminate JavaScript Code Smells

Elijah Manor

Thumbnail for When All You Have is a Hammer, Every Problem Looks Like a Nail

When All You Have is a Hammer, Every Problem Looks Like a Nail

Ben Birch

More presentations from Code 2015

    Thumbnail for The State of the Animation

    The State of the Animation

    Rachel Nabors

    Thumbnail for What Comes Next for the Web Platform?

    What Comes Next for the Web Platform?

    Alex Russell

    Thumbnail for Async and Await

    Async and Await

    James Hunter

    Thumbnail for Classing up ES6

    Classing up ES6

    Andy Sharman

    Thumbnail for Canvas Cold War

    Canvas Cold War

    Simon Swain

    Thumbnail for Current Best Practice in Front End Ops

    Current Best Practice in Front End Ops

    Alex Sexton

    Thumbnail for Stop the Fanaticism – Using the Right Tools for the Job

    Stop the Fanaticism – Using the Right Tools for the Job

    Kassandra Perch

    Thumbnail for Pop-up Accessibility

    Pop-up Accessibility

    Rhiana Heath

Conffab
  • About
  • Speakers
  • Presentations
  • Conferences
  • Contact
  • Sign in
Sign Up

© Conffab 2025