Nest.js | Events & Task Scheduling Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ม.ค. 2025

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

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

    Get my highly-rated Udemy courses at a discount here: michaelguay.dev/udemy/

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

    Great video, Michael! One of the very few channels making such informative videos on NestJS. Looking forward to your next one - the end to end guide on micro-services using NestJS.

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

      I hope you are planning to include a tutorial on how to deploy them on AWS. 🤞😇

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

    Love how you explain. I just started out with nestjs last week and watching this video shows me how much I can improve. Thanks for the awesome content.

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

    Nestjs is so cool !! My company has a plan on switching to nestjs. Thanks for these contents man!

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

    Amazing nestjs channel, thank you for your explanations, liked, subscribed

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

    Thank you for making actually useful videos and not just how to create a todo or something.

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

    You are best backend developer bro💪🤩

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

    I just subscribed to your channel because of this, man. I love it.

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

    You're the best bro. I love your videos

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

      I appreciate that!

  • @Khalil.WebDev
    @Khalil.WebDev 10 หลายเดือนก่อน

    Impressive tutorial 😊
    Subscribed ✅

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

    thank you SO much for explanation !!!!!

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

    Cool! Thanx a lot, bro! Info as always useful!!

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

    Hi Michael, I was trying to implement a functionality with events, to run several operations in a transaction, but I don't know how to handle it, so everything is rolled back if any of the operations fail. would you mind giving an advice on how to do that kind of behaviour?

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

    This was a really good video

  • @BrandonBailey-v8s
    @BrandonBailey-v8s ปีที่แล้ว

    This is amazing Michael! regarding scaling and fault tolerance, as the schedule registry is in memory, how would you handle distributing this? would you consider making a vid about this?

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

      Hey thanks. The recommended approach for distributing this is to use something like BullMQ. Check out my channel for a video on that.
      github.com/nestjs/schedule/issues/28

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

    Hey Michael, really great video!
    One quick question: Can the event be listened from any module of the app or only inside the class where you emit it from?
    Keep up the amazing NestJS videos!!

    • @mguay
      @mguay  10 หลายเดือนก่อน +1

      We can listen from anywhere. It can even be from messages produced from a different app!

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

      @@mguay whaat?! how does it do that? Do you have any resources about it?
      Also, do you happen to have a community place like a discord server or anything like that?

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

    Thanks! Great as always!

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

    I got one question, you said that this event in async mode is send to the separate thread. I think it is not true. Js is single threaded, also node (without some internal apis from Libuv) but the EventEmitter is build in javascript and works in sync manner. I know that nest js is using event emmiter 2 that is async aware but anyway it is not handled in separate thread. If Im wrong please correct me, Im trying to solve the misery how this emitter works in Nest and the async manner is purely described even in official event emmiter 2 docs.

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

    I am a php developer (laravel) and i have to admit it, i was pretty skeptical about node (not this framework, node in general). It seems cool and your video are very clear. What i really don't like is that the cose is quite confusing. In controller you can have http handler (post, get,...) and events handler. I think this can cause messy code very faster than other framework, and the unmessy behavior is demanded to the developer.

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

      😂.. well, it's opinionated.. every framework has its downsides.. a downside for me might be an advantage for you

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

      @@samuelvalentine7846 attitude says all!

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

    Thank you for this amazing video. Quick question Michael, how should one decide whether or not to use Events or Queues?

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

    Please tell me: what theme are you using? I love those colors

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

    Can I use events for notification like while user fill up the form that will notify the admin through event?

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

    in case where use is registered, and then a gift is sent to the user, but after that we want to make some update on the user, so how do we send data back to the function from where the event is dispatched? any ideas ?

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

      Have you tried emitAsync?

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

    Did it hurt when you fall? I'm talking about that time god sent you to the earth from the sky, CUZ YOU ARE A GODDAMN ANGLE!

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

    I wondering how we can prevent overlapping cron? I search so many topic on SO but still can't find a solution :(

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

    Great video Michael! Trying to reproduce the events in one of my projects, I encountered a problem... The event is only emitted once, but the OnEvent listener is firing twice. Any idea why??

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

    can you make a video on queue with bulljs

  • @nolw.7805
    @nolw.7805 ปีที่แล้ว

    Omg. Its so good video!

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

    Awesome content! Btw which font do you use?

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

      Material!

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

    Cool stuff. Is `Emit` stuff more like a message-queue stuff? You know, celery in Python.

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

    Any tips on managing cron like processes on multiple instances? been using bull repeatable jobs but it's feels a bit janky.

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

      I plan on making a video in the future. I would think Bull would be a good candidate since it can be backed by a distributed Redis store, but I haven’t tried it yet so maybe it’s not so great like you point out.

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

      @@mguay It works ok it just doesn't have the great dev UX those @Cron decorators. Thanks for all the video's found the ones you did on testing on nest.js really helpful!

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

      The Bull repeatable jobs integration is definitely janky, but it does work

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

      I guess it depends on the deployment.
      If it is a kubernetes stack you could simply make a cronjob which will make a fetch and the load balancer will make sure it only is executed once.

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

    What if container in cloud gets killed ?

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

      Great question. Check my latest video on BullMQ

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

    any different when comparing to use kafka

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

      They can both be used to implement an event-driven approach, but i think Kafka is more sensible for processing large quantities of messages for performance reasons - as it allows a distrubted system, and other reasons like fault tolerance, etc.

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

    Good!

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

    Thanks bro

  • @Dave-hu9wf
    @Dave-hu9wf 2 ปีที่แล้ว

    👇 𝔭𝔯𝔬𝔪𝔬𝔰𝔪