Web Directions

Conffab

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

Async Frontiers in JavaScript

Domenic Denicola at Code 2015
  • JavaScript
Sign up for a free membership to watch this and hundreds of other videos
  • Details
  • Slides
  • 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 Choosing Your Animation Adventure

    Choosing Your Animation Adventure

    Thumbnail for Debugging Apps with JS Frameworks

    Debugging Apps with JS Frameworks

    Thumbnail for Accessibility: Small Steps for a larger Audience

    Accessibility: Small Steps for a larger Audience

    Thumbnail for Auth on the web: better experiences

    Auth on the web: better experiences

    Thumbnail for HOT Animation!

    HOT Animation!

    Thumbnail for Making Modern JavaScript Frameworks Accessible

    Making Modern JavaScript Frameworks Accessible

    Thumbnail for WebAssembly, your browser’s sandbox

    WebAssembly, your browser’s sandbox

    Thumbnail for Optimizing the performance of third-party dependencies

    Optimizing the performance of third-party dependencies

More presentations from Code 2015

    Thumbnail for Async and Await

    Async and Await

    Thumbnail for Current Best Practice in Front End Ops

    Current Best Practice in Front End Ops

    Thumbnail for The State of the Animation

    The State of the Animation

    Thumbnail for Back to the Future with Web Components

    Back to the Future with Web Components

    Thumbnail for Getting Offline with the Service Worker

    Getting Offline with the Service Worker

    Thumbnail for Eliminate JavaScript Code Smells

    Eliminate JavaScript Code Smells

    Thumbnail for ES6 Symbols, What They Are and How to Use Them

    ES6 Symbols, What They Are and How to Use Them

    Thumbnail for What Comes Next for the Web Platform?

    What Comes Next for the Web Platform?

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

© Conffab 2023