Node.js Tutorial - 42 - Event Loop

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ย. 2024
  • ⚡️Syncfusion components: syncf.co/3Emhvnv
    📘 Courses - learn.codevolu...
    💖 Support UPI - support.codevo...
    💖 Support Paypal - www.paypal.me/...
    💾 Github - github.com/gop...
    📱 Follow Codevolution
    + Twitter - / codevolutionweb
    + Facebook - / codevolutionweb
    📫 Business - codevolution.business@gmail.com
    Event Loop
    Event Loop in Node.js
    Node.js Event Loop
    Node.js Tutorial
    Node.js Tutorial for Beginners

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

  • @watherby29
    @watherby29 ปีที่แล้ว +78

    You are literally the only person that, when explaining, makes me remember all I listened and watched. Amazing. Don't know how you do it. Thank you.

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

      Was about to say the same thing!

    • @bassam.2023
      @bassam.2023 ปีที่แล้ว

      What don't you get? Vishvas is a Master teacher, that's why.

    • @nandannandan5910
      @nandannandan5910 23 วันที่ผ่านมา

      yes I have same experience

  • @pigra24
    @pigra24 ปีที่แล้ว +14

    One of the best high-level explanation of the event loop, ever!! Thank you so much for this.

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

    This content is gold, hope you're planning for the cluster module and (exec, spawn, fork) with deep explanation in your next vods

  • @ImAkid-ss5pb
    @ImAkid-ss5pb 11 หลายเดือนก่อน +2

    Best nodejs playlist I ever came across youtube

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

    Impressed by the flawlessly flowness of teaching.

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

    I swear I love you. I'll learn anything you teach. Now I can picture the event loop. I'm happy. I'm just walking around and laughing

  • @cl-7832
    @cl-7832 7 หลายเดือนก่อน

    Hands down the best presentation on this topic! Wow! Thank you.

  • @mitalisingh533
    @mitalisingh533 4 หลายเดือนก่อน

    The best explanation i ever watched of this topic. I have been facing a lot of trouble lately understanding javascript's async behaviour. I think i am gonna find the solution here only. Too good. Really appreciable.

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

    this is by far one of the brilliantly articulated video out there that too for free wrt node js event loop... thanks a ton

  • @shubhamkareer
    @shubhamkareer 9 หลายเดือนก่อน

    The way yo taught this process of event loop amazed me. Hats off to your skills.

  • @AhmedMohammed-ks8uo
    @AhmedMohammed-ks8uo ปีที่แล้ว +2

    Thank you, Vishwas for this fantastic course. you are always the best choice to explain any topic

  • @quannguyenhoang2481
    @quannguyenhoang2481 26 วันที่ผ่านมา

    the second time watching this video after one week and getting know well. Thank you a lot

  • @RehanKhan-xf3ml
    @RehanKhan-xf3ml 5 หลายเดือนก่อน

    You are the best 💡
    I saw a lot of vids and tuts but this demonstration is simply amazing

  • @AliRaza-ru6fx
    @AliRaza-ru6fx ปีที่แล้ว +3

    visual representation is more effective than explaining thing without it. Thanks @vishwas sir.

  • @swapnil511994
    @swapnil511994 4 หลายเดือนก่อน

    you are a god in a mortal's body. the best explanation till date

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

    Thank you, thank you! You are a star and you have earned a subscriber. Well explained and I now have the required confidence to understand as to what is going on the event loop.

  • @HEAVYMETAL80tas
    @HEAVYMETAL80tas 7 หลายเดือนก่อน

    Waaaoo!! Is a great experience to watch this just like a good movie.. It is so entertaining and digestable for this articulated concept. Is very enjoyable to have this understanding, how everything fits! 👌🍿🔥

  • @user-sv2dg7bz8m
    @user-sv2dg7bz8m 4 หลายเดือนก่อน

    best explanation of event loop to date. no one does better.

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

    This is the best explanation of nodejs event loop

  • @amolagarwal5336
    @amolagarwal5336 11 หลายเดือนก่อน +1

    The best explanation I have ever had on the event loop. you rock Vishwas. Thanks for the video

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

    Wonderful work, sir. I read some article in internet and noone more clear than your video. Thank you so much

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

    Well researched video. No video of event loop on youtube told me that the libuv is just a C program. Nice.

  • @Quoccute854
    @Quoccute854 4 หลายเดือนก่อน

    Best nodejs event loop explanation, thank you 😍

  • @caaltz
    @caaltz 9 หลายเดือนก่อน

    this course is a treasure

  • @shantanusinha3609
    @shantanusinha3609 3 หลายเดือนก่อน

    Great explanation!

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

    Thanks a lot sir Vishwas,ypu're an incredible teacher

  • @celestenzeza520
    @celestenzeza520 4 หลายเดือนก่อน

    I think there's a mistake around the 11:32 mark on step number 3. Based on my understanding, If a task in the timer queue (or any macrotask queue) enqueues a microtask (say you have a promise inside a setTimeout callback) the event loop will not execute the other macrotasks in that queue and start executing from the microtask queue until it is empty again.

    • @celestenzeza520
      @celestenzeza520 4 หลายเดือนก่อน

      this code snippet prints 1, 2, 3, 4, 5, 6
      function main() {
      console.log('1');
      setTimeout(() => {
      console.log('3');
      // this is a microtask within the callback of a macrotask
      process.nextTick(() => {
      console.log('4');
      });
      // this is a macrotask within the callback of a macrotask
      setTimeout(() => {
      console.log('6');
      }, 0);
      }, 0);
      setTimeout(() => {
      console.log('5');
      }, 0);
      process.nextTick(() => {
      console.log('2');
      });
      }
      main()

  • @abdulhashik
    @abdulhashik 6 หลายเดือนก่อน +1

    It’s better to show the order of execution or priority in the diagram itself

  • @BRUNANAIANMOREIRALIMAGARCIA
    @BRUNANAIANMOREIRALIMAGARCIA 5 หลายเดือนก่อน

    That was very well explained, thank you

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

    THANK YOU VERY MUCH FOR THE COURSE!!
    Best explanation yet.

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

    Great explaination on event loop!! Thank you.

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

    amazing, best explaination ever!...

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

    8:30 the event loop visualization and the different queues inside it

  • @균서
    @균서 4 หลายเดือนก่อน

    설명 진짜 개쩐다 말이 안됨... 이사람은 신이야

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

    Very informative video with visual representation and it's explanation. Thank you

  • @raghavenderkuppireddy7158
    @raghavenderkuppireddy7158 4 หลายเดือนก่อน

    Beautiful explanation ❤❤❤❤❤

  • @DanZ-fq2qs
    @DanZ-fq2qs ปีที่แล้ว

    Thanks for the video! I need to point out that Execution order is incorrect.
    The micro task queue will not wait for all callbacks within the timer queue are executed. Instead for Node 11+ nextTick callbacks and microtasks will run between each individual setTimeout and setImmediate callbacks, even if the timers queue or the immediates queue is not empty.

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

      Yes, I tested this.

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

    Really great explanation and on point with visual representation 👍

  • @BruceWayne-kw6xm
    @BruceWayne-kw6xm 9 หลายเดือนก่อน

    The Only Best Video On TH-cam or in any paid video about the explaination of event loop... hats off to vishwas 🫡🫡🫡🫡

  • @js_programmer8423
    @js_programmer8423 11 หลายเดือนก่อน

    variables are stored on the call stack, not the memory heap.

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

    thanks teacher, 42 it was great!

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

    Thank you Vishwas 🙏🏾

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

    really great representation and explanation 😎 awesome as always

  • @AHMED-nd7zt
    @AHMED-nd7zt 4 หลายเดือนก่อน

    that was really nice

  • @yashgaur1716
    @yashgaur1716 11 หลายเดือนก่อน

    That was some great explanation

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

    Great knowledge sharing video

  • @DuckpoolOfficial
    @DuckpoolOfficial 2 หลายเดือนก่อน +1

    waiting for express js tutorials

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

    Gooo job however, i will be glad if you can use explain the last-in-first-out principle using the console

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

    Thanks!

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

    Great explanation sir..😍😍😍

  • @Николай-г5т6ч
    @Николай-г5т6ч ปีที่แล้ว

    Many thanks. How many videos are planned for this playlist?

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

    Hi Vishwas, thanks for the amazing content. Looking forward to the Express course, when are going to drop it?

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

    Great explanation, but isn't it a mistake in 11:20? "All callbacks within the timer queue are executed" - is it true? Not only limited amount of them?

  • @yasmeinSalem44
    @yasmeinSalem44 2 หลายเดือนก่อน

    it's the best explanation, thank you so much

  • @JishnuGeeks
    @JishnuGeeks 2 หลายเดือนก่อน

    Bro You mistakenly said js is blocking but JavaScript itself is not inherently blocking or non-blocking; it depends on how it's used in different environments. In the context of web browsers, JavaScript traditionally operates in a non-blocking manner, especially when handling asynchronous tasks like fetching data from a server. However, JavaScript code can be written in a blocking manner if operations are performed synchronously without utilizing asynchronous capabilities.
    The other lecture is good, keep it up

  • @NeuronEnix
    @NeuronEnix 3 หลายเดือนก่อน

    setImmediate seems to run before setTimeout, does that mean check queue is executed first before timer queue ?
    I'm on node v20.14.0
    setTimeout(() => console.log("timeout"))
    setImmediate(() => console.log("immediate"))
    ouput:
    immediate
    timeout

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

    great explanation

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

    Thanks

  • @Shivam-sl4sp
    @Shivam-sl4sp 9 หลายเดือนก่อน

    Thanks man!!

  • @lekhiem7572
    @lekhiem7572 9 หลายเดือนก่อน

    The cycle diagram appears to be outdated. I would recommend referring to the official site for an updated explanation, which is provided below:
    - A process.nextTick callback is added to process.nextTick queue. A Promise.then() callback is added to promises microtask queue. A setTimeout, setImmediate callback is added to macrotask queue.
    - Event loop executes tasks in process.nextTick queue first, and then executes promises microtask queue, and then executes macrotask queue.

    • @prateek1369
      @prateek1369 9 หลายเดือนก่อน

      could you pls point me to some reference that talks about this change. I'm very confused rn

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

    Thanks a lot 🙏

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

    Oh damn! This is useful

  • @soumadip_skyy_banerjee
    @soumadip_skyy_banerjee 11 หลายเดือนก่อน +1

    HOW TO GET HOLD OF YOUR SLIDES? PLEASE PLEASE PLEASE REPLY ❤

  • @onlineofathing9351
    @onlineofathing9351 8 หลายเดือนก่อน

    You said javascript is synchronous but the new javascript - ES6 uses async functions? Am a bite confused

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

    I am wondering how those tasks in the low-priority queues are executed at all

  • @fawwadk1
    @fawwadk1 2 หลายเดือนก่อน

    Does promise queue is same as promise function of javascript?

  • @RamKumar-es3mp
    @RamKumar-es3mp ปีที่แล้ว

    Great content. Please upload RXJS videos please

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

    Liiiii__Buuuu__V_________ 😀 ! Loved it ! Man thanks for this explaiation ! 👍

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

    wow thanks again

  • @AlaminHossain-hf2gv
    @AlaminHossain-hf2gv ปีที่แล้ว

    Helpful video

  • @muhammadwaqar-u5e
    @muhammadwaqar-u5e 2 หลายเดือนก่อน

    just watched 4:30 and i already your fan sir... you got my sub, my support and lots of love (^_^)

  • @RajYadav-fy4lm
    @RajYadav-fy4lm ปีที่แล้ว

    just wanted to ask what would be the last topic fo the event loop playlist?

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

    Hey,
    I have a question - for any queue other than the Microtask queue will the event loop wait for it to finish with all of its callbacks before checking in with the Microtask queue, or will it check the Microtask queue after when each and every callback is executed and popped off from the call stack.
    Considering the call-stack is now empty, it should ideally check with the Microtask queue first before picking up any other cb() from the other queues.
    Hope, I am able to explain my question.
    Thanks.

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

      I got my answer from the following sessions, so please ignore.
      Although I think this video @11.37 seconds needs to be corrected as it says in point no #2,#4,#6,#8 seems a bit misleading to me

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

    Sr can you do a series about SOLID pirnciples on a react app please?

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

    What about the events created by eventemitter there is no details about it

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

    you have mentioned setTimeout and setInterval callbacks are given first priority, but actually..........
    In the Node.js event loop, the execution of setTimeout and setInterval callbacks is not given first priority. These callbacks are enqueued in the event queue after their specified delay or interval, and they are not immediately executed when their time is up. Instead, they will be executed only when the event loop has the opportunity to process them.

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

      Also he said that synchronus code will always run before async code. That's why call stack needs to run synchronus code first. When stack got empty then event loop will start to push async code.

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

      The event loop works in a loop...
      Recall the diagram..setTimeout and setInterval are given first priority but even loop works in a loop..if it is in the middle of the evvent loop, the timeout events have to wait till loop is complete and their turn comes

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

    🙏🙏

  • @nishantsatere9350
    @nishantsatere9350 2 หลายเดือนก่อน

    GODDDDDDDDDDDDD

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

    NodeJS be like: Yeh toh Dhoti khol raha hai

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

    Redis Series please 🙂!

  • @sidhantkumarsingh2
    @sidhantkumarsingh2 10 วันที่ผ่านมา

    .

  • @dannnsss8034
    @dannnsss8034 2 หลายเดือนก่อน

    Do you really need to understand all of this? I just have to 'know node' for work. I'm thinking of skipping these Event Loop videos, go straight to the NPM videos.

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

    What will be the order of execution if we have setImmediate and setTimeout(fn,0) @codeevolution

  • @ManiKandan-i5v
    @ManiKandan-i5v 11 หลายเดือนก่อน

    console.log("Start");
    setTimeout(() => {
    console.log("Timer Callback 1");
    }, 1000);
    setTimeout(() => {
    console.log("Timer Callback 2");
    }, 500);
    const fs = require('fs');
    fs.readFile('example.txt', (err, data) => {
    if (err) {
    console.error("I/O Callback (Read File) Error:", err);
    } else {
    console.log("I/O Callback (Read File)");
    }
    });
    setImmediate(() => {
    console.log("Immediate Callback");
    });
    console.log("End"); when im trying to run this code timer queue callbacks running after all the callbacks why according to priority timer queue should run first right

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

    Just one word for you AWESOME🥸