• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patterns in JavaScript
 

Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patterns in JavaScript

on

  • 60,511 views

This talk takes a deep dive into asynchronous programming patterns and practices, with an emphasis on the promise pattern. ...

This talk takes a deep dive into asynchronous programming patterns and practices, with an emphasis on the promise pattern.

We go through the basics of the event loop, highlighting the drawbacks of asynchronous programming in a naive callback style. Fortunately, we can use the magic of promises to escape from callback hell with a powerful and unified interface for async APIs. Finally, we take a quick look at the possibilities for using coroutines both in current and future (ECMAScript Harmony) JavaScript.

Statistics

Views

Total Views
60,511
Views on SlideShare
58,840
Embed Views
1,671

Actions

Likes
153
Downloads
651
Comments
5

20 Embeds 1,671

http://www.scoop.it 881
http://madmica.usask.ca 537
http://www.redditmedia.com 75
https://twitter.com 63
http://paper.li 30
http://a0.twimg.com 28
http://www.linkedin.com 13
https://si0.twimg.com 9
http://sprint21er.wordpress.com 8
http://localhost 5
http://www.techgig.com 4
https://twimg0-a.akamaihd.net 4
http://lifeofjs.com 3
http://us-w1.rockmelt.com 3
http://128.233.110.158 2
http://coderwall.com 2
http://safe.txmblr.com 1
http://ja.twitter.com 1
http://www.pinterest.com 1
http://pinterest.com 1
More...

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

15 of 5 previous next Post a comment

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Mere pedantry, but there's a bug (which I don't think was intentional) on slide 35/36; your implementation of `parallel` will populate the `results` array in an arbitrary order, but you use it on slide 36 as though the `results` array is guaranteed to be in the same order as the `actions` array.
    Are you sure you want to
    Your message goes here
    Processing…
  • I don't see how the #61 is different from the #59. In both case the process is async and we cannot tell if the call will be executed before the last console.log(). Or I'm missing something... and I would'nt be surprised to.
    Are you sure you want to
    Your message goes here
    Processing…
  • Pretty lucid, great!!!
    Are you sure you want to
    Your message goes here
    Processing…
  • See also http://www.slideshare.net/domenicdenicola/promises-promises for a different pedagogical approach.
    Are you sure you want to
    Your message goes here
    Processing…
  • Very clearly explained and thorough. One of the best I've seen on promises and why we might want to use them.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Decouples the action from the subsequent use of the result.

Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patterns in JavaScript Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patterns in JavaScript Presentation Transcript