No video

Nest.js | Events & Task Scheduling Tutorial

In this video, we learn about how to decouple functionality in our application leading to faster backend services and cleaner code.
Github Repo: github.com/mgu...
Nest.js Events: docs.nestjs.co...
Nest.js Tasks: docs.nestjs.co...
Timestamps
00:00:00 Project Setup
00:03:50 Events
00:09:17 Task Scheduling
Get my highly-rated Udemy courses at a discount here: michaelguay.de...

Пікірлер: 50

  • @mguay
    @mguay6 ай бұрын

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

  • @gulsharangoraya6707
    @gulsharangoraya67072 жыл бұрын

    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 Жыл бұрын

    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
    @chess49642 жыл бұрын

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

  • @dawid_dahl
    @dawid_dahl Жыл бұрын

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

  • @kirakira160
    @kirakira1602 жыл бұрын

    You are best backend developer bro💪🤩

  • @princeigwe8206
    @princeigwe82062 жыл бұрын

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

  • @waldomalave3126
    @waldomalave31262 жыл бұрын

    You're the best bro. I love your videos

  • @mguay

    @mguay

    2 жыл бұрын

    I appreciate that!

  • @jrs_devs
    @jrs_devs4 ай бұрын

    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?

  • @alexandervasilenko7773
    @alexandervasilenko77732 жыл бұрын

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

  • @williamx0
    @williamx02 жыл бұрын

    Thanks! Great as always!

  • @Khalil.WebDev
    @Khalil.WebDev5 ай бұрын

    Impressive tutorial 😊 Subscribed ✅

  • @21Blankenship
    @21Blankenship Жыл бұрын

    This was a really good video

  • @Cyandog
    @Cyandog5 ай бұрын

    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

    5 ай бұрын

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

  • @Cyandog

    @Cyandog

    5 ай бұрын

    @@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?

  • @ramonbsales
    @ramonbsales6 ай бұрын

    Good!

  • @lumgashi3076
    @lumgashi30765 ай бұрын

    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

    4 ай бұрын

    Have you tried emitAsync?

  • @ryanisthewind
    @ryanisthewind Жыл бұрын

    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!

  • @user-xj8wj7pt8o
    @user-xj8wj7pt8o11 ай бұрын

    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

    11 ай бұрын

    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

  • @gbengacodes
    @gbengacodes Жыл бұрын

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

  • @trale2431
    @trale24312 жыл бұрын

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

  • @jakubpiecyk4464
    @jakubpiecyk446411 ай бұрын

    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.

  • @sagar7929
    @sagar79292 жыл бұрын

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

  • @nolw.7805
    @nolw.7805 Жыл бұрын

    Omg. Its so good video!

  • @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!

  • @tom_c
    @tom_c Жыл бұрын

    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
    @huththo2 жыл бұрын

    can you make a video on queue with bulljs

  • @esdegan7176

    @esdegan7176

    Жыл бұрын

    +1 cmon buddy

  • @patrykkowalski1305
    @patrykkowalski13052 жыл бұрын

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

  • @michaelyao9389
    @michaelyao93892 жыл бұрын

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

  • @shadow16810
    @shadow16810 Жыл бұрын

    Awesome content! Btw which font do you use?

  • @mguay

    @mguay

    Жыл бұрын

    Material!

  • @2penry2
    @2penry22 жыл бұрын

    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 жыл бұрын

    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

    Жыл бұрын

    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.

  • @EmmanuelOdii80
    @EmmanuelOdii80 Жыл бұрын

    Thanks bro

  • @wayneyu3031
    @wayneyu30312 жыл бұрын

    any different when comparing to use kafka

  • @mguay

    @mguay

    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.

  • @Trooperos90
    @Trooperos90 Жыл бұрын

    What if container in cloud gets killed ?

  • @mguay

    @mguay

    Жыл бұрын

    Great question. Check my latest video on BullMQ

  • @Dave-hu9wf
    @Dave-hu9wf2 жыл бұрын

    👇 𝔭𝔯𝔬𝔪𝔬𝔰𝔪