Asynchrony: Under the Hood - Shelley Vohr - JSConf EU

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 มิ.ย. 2018
  • This talk will explore the conceptual underpinnings of asynchronous programming options, and the drawbacks and advantages to each. JS has supported callbacks since 2009, and as years have gone by it’s added support for promises, generators, and now async/await. On a surface level, each of these techniques seeks to answer a question of how to access data not immediately available, but a deeper look into how each works on a granular level will show their implementation differences and how these differences affect usage. We’ll also take a look at how intermediate values, and errors are affected by each method. I’ll walk through a series of scenarios so you can better visualize performance differences, and how each method propagates data through the stack and the event loop. Finally, I’ll talk about where the future of async may be headed. Armed with new knowledge from this deep dive, the potentially treacherous road to fully understanding async will hopefully become a smoother ride!
    OMG JSConf EU is coming back in 2019 2019.jsconf.eu/
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 55

  • @bagoquarks
    @bagoquarks 6 ปีที่แล้ว +93

    Callbacks, promises, generators, and async/await all explained in 25 minutes. Well done!

  • @Dygear
    @Dygear 4 ปีที่แล้ว +11

    It takes so much effort to make something complex, easy to understand. This is a really impressive talk!

  • @pixelpaxal
    @pixelpaxal 6 ปีที่แล้ว +25

    If you already have a good grasp of callbacks, promises and async/await in javascript, this talk is a good review to put these these things into perspective and language evolution context, it could help one understand when to use one over the other.

  • @paulalexwilson
    @paulalexwilson 4 ปีที่แล้ว +13

    Truly understanding something requires that we have a solid appreciation of at least 1 abstraction deeper. This talk was exactly what I was looking for.

  • @toxicdesire8811
    @toxicdesire8811 6 ปีที่แล้ว +37

    Most underrated talk of entire jsconf

  • @sandeepparmar3113
    @sandeepparmar3113 5 หลายเดือนก่อน +1

    In the hell of tutorials, This is the true gem

  • @ITWorx
    @ITWorx 3 ปีที่แล้ว +3

    A very good explanation for promises vs callbacks, thank you!

  • @ClanProStarZ
    @ClanProStarZ 6 ปีที่แล้ว +10

    Truly impressed by this talk. I thought I knew everything about async/await and promises but she proved me wrong.

  • @mojojojo1211
    @mojojojo1211 4 ปีที่แล้ว +2

    This is a great talk. Deserves more views!

  • @arunas1
    @arunas1 6 ปีที่แล้ว +1

    Thanks @Shelley Vohr! Good job!

  • @maltegb
    @maltegb 3 ปีที่แล้ว +1

    Great talk! Everything clearly explained

  • @sanderd17
    @sanderd17 5 ปีที่แล้ว +1

    I wanted to have seen this talk so much earlier. Very well done.

  • @kps2642
    @kps2642 6 ปีที่แล้ว +1

    awesome talk, thank you.

  • @randy4ii411
    @randy4ii411 2 ปีที่แล้ว

    Thanks for the awesome lesson.

  • @josephlee5829
    @josephlee5829 2 ปีที่แล้ว

    Excellent Job explaining!

  • @abhikumar2469
    @abhikumar2469 5 ปีที่แล้ว +4

    Damn...! this engineer got some serious and rare content on callback, promises and async/await.

  • @jameswon5497
    @jameswon5497 4 ปีที่แล้ว

    Really great talk!

  • @payphones
    @payphones 6 ปีที่แล้ว +29

    21:00 actually made me go "ohhhhhhhhhh"

    • @alexagna
      @alexagna 6 ปีที่แล้ว +10

      Indeed ! The combination of destructuring, async/await and Promise.all() to have a non-blocking version of multiple await is really smart

  • @makhdv
    @makhdv 6 ปีที่แล้ว +28

    Thanks! Needed some time to get use to academic style.

    • @sijanshrestha7278
      @sijanshrestha7278 5 ปีที่แล้ว

      yup i had to use notebook to write, but was explained clearly :) :D

    • @sKopheK
      @sKopheK ปีที่แล้ว

      probably cause she read it

  • @dixztube
    @dixztube ปีที่แล้ว

    This was so goood. Great job!

  • @nztuber
    @nztuber 4 ปีที่แล้ว +7

    Great stuff!
    At 5:38 to be clear, the execution order suggested on the right is not true for *all* callbacks, only *asynchronous* callbacks.
    (If they are synchronous callbacks then the invocation order would be doA, doB, doC, doD, doE, doF)

    • @rtech8779
      @rtech8779 4 ปีที่แล้ว

      yaa thats right its applicable for async calls only, for sync call it will wait in the call stack.

    • @yuansizhu6271
      @yuansizhu6271 2 ปีที่แล้ว

      So that's why callbacks are not guaranteed to be asynchronous. But promises are, even when they are already resolved/rejected.

  • @ssougnez
    @ssougnez 6 ปีที่แล้ว +8

    Awesome ! It would be even more perfect with a mention to Observables though. But congratulation, very clear and sweet to listen to :-D

  • @singingofstars
    @singingofstars 5 ปีที่แล้ว +1

    Nice job. Easy to understand.

  • @ahmedal-obaidi792
    @ahmedal-obaidi792 4 ปีที่แล้ว +3

    pretty much reading "YDKJS: async & performance"

  • @Mostafaabobakr7
    @Mostafaabobakr7 5 ปีที่แล้ว +1

    Love the Intro Music

  • @Henrique-yw1rb
    @Henrique-yw1rb 6 ปีที่แล้ว +55

    First slide is a meme of Nazaré, a character from a famous tv show here in brazil! LOL

  • @asianfoodie5908
    @asianfoodie5908 3 ปีที่แล้ว +1

    Well executed!! most of the time i ignored error handling, not anymore :)

  • @vscode4232
    @vscode4232 3 ปีที่แล้ว

    Great talk

  • @alabidavid4674
    @alabidavid4674 4 ปีที่แล้ว +2

    Generators could have an end. That's property done set to true in which case they stop yield anything but done:true. Also, you can terminate generators by return();

  • @hkjpotato
    @hkjpotato 2 ปีที่แล้ว +1

    good summary of you dont know JS
    1. now. and then, run to complete, continuation, trust. Exception is sync?
    2. yield control to event loop?
    3. promise is microtask queue, a placeholder of a future status
    4. before anyelse can happen

  • @anastazjawrobel8040
    @anastazjawrobel8040 3 ปีที่แล้ว

    Super :)

  • @enzoscardamaglia9565
    @enzoscardamaglia9565 4 ปีที่แล้ว

    "Since they're not running in the top-down sequential order you might expect." at 05:57.
    Has anyone tried that out?
    If I'm not mistaken in Node, FF, Chrome and Edge the functions run exactly in the sequential order I'm expecting.

    • @electroaddiction
      @electroaddiction 4 ปีที่แล้ว +1

      Since every callback is asynchronous (eg: setTimeout(cb, 0)), it will execute in the order specified.

  • @floopy312
    @floopy312 5 ปีที่แล้ว +2

    13:21 Can somebody write me a piece of code with an "infinite microtask loop" like she mentions, I'm not sure how you can do that.

    • @monolizm
      @monolizm 5 ปีที่แล้ว +3

      you can find the answer here at 27 min th-cam.com/video/cCOL7MC4Pl0/w-d-xo.html.

    • @romankos3283
      @romankos3283 5 ปีที่แล้ว +5

      const loop = () => Promise.resolve(loop); loop();

  • @HarshitSharma-cd4tr
    @HarshitSharma-cd4tr 3 ปีที่แล้ว

    Every Single time you call dot then on a promise it creates and return a new promise

  • @biboswanroy6699
    @biboswanroy6699 5 ปีที่แล้ว

    I aren't yet sure of the role of queues and their scope exactly.

    • @terranova3941
      @terranova3941 5 ปีที่แล้ว

      I just watched this prior and is maybe what you are looking for: th-cam.com/video/8aGhZQkoFbQ/w-d-xo.html

  • @halakhita_hk
    @halakhita_hk 4 ปีที่แล้ว

    good ..

  • @giullianopaz8262
    @giullianopaz8262 5 ปีที่แล้ว +6

    Brazilian meme in the first slide haha

  • @dumbfailurekms
    @dumbfailurekms 10 หลายเดือนก่อน

    i googled her name and looked at her github and immediately realized i have no fking chance in this field

  • @BinaryReader
    @BinaryReader 5 ปีที่แล้ว

    Inversion of Control doesn't cause significant trust issues.

  • @ElChitarrino
    @ElChitarrino 2 ปีที่แล้ว +2

    Really great stuff there, thanks a lot! However, I feel the urge to mention it's quite hard to follow due to your verbal breaks each 3-5 syllables. No offense intended.

  • @nischalofchrist
    @nischalofchrist 2 ปีที่แล้ว +1

    great lesson, learnt a lot, but she should really evaluate how to dress when you are invited to be a speaker in such a huge event.

    • @kazmonroy
      @kazmonroy ปีที่แล้ว +4

      Have you seen how other male developers dress when they go to other big conferences? Geez. She's totally fine.

  • @felipepino834
    @felipepino834 ปีที่แล้ว

    Quiero aprender inglés 😪😪😪🥺 para entender mejor.
    Y si ya se que TH-cam tiene subtitulos gracias

  • @philliplam2704
    @philliplam2704 ปีที่แล้ว

    Her expertise on this shit is srsly turning me on 😂