-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Events for Danet #75
Comments
Hey @marco-souza, thank you for this Feature Request. I like it, is it something your would be willing to implement natively in Danet, in a separate module, similar to how the Swagger module work ? If not, I might have some time to draft something this weekend or next week's ! |
@Sorikairox Thank you for the availability. I was imagining it as a separate module, as you mentioned. I'm interested in working on it, but unfortunately, I won't have the time until the prod release in my job, planned for 1st week of next month. If you have the time to draft something it would be great! I can help to discuss the proposal, review the code changes, and test it. |
Hey @marco-souza ! I took a look at Nest implementation and your feature request. There are 2 distinct possible features: Local event basedSimilar to: https://docs.nestjs.com/techniques/events These are "local" events across the instance, using the Queue/PubSubSimilar to: https://docs.nestjs.com/techniques/queues Listening and sending data to a Queue, and we can extrapolate that we can make it work with Pub/Sub too without too much trouble. From my understanding, you would like the latter so I will start with that with Deno.Kv first (even if both are cool and needed for different use cases). I have a somewhat clear idea of how to implement that. |
That's great @Sorikairox, thanks! Regarding the local events, I also find it super handy for different use cases. Today I had some time to draft an
I implemented it as an internal module of I'm not sure if it helps the Queue/PubSub feature, but let me know if we can join efforts to have both features 💪🏼 |
@marco-souza Thank you for the PR ! Commenting on it. I will have time to start working on the Queue/PubSub feature this weekend ! |
Hello @Sorikairox 👋 This weekend I was also looking at my personal list of nestjs features that I use most, the next one would be the I imagine It would be similar to the
|
Hey @marco-souza !
I think that tree-shaking is enough to reduce the framework size in bundling/production anyway ? It's a problem for later ! |
Totally agree with you! |
Is your feature request related to a problem? Please describe.
As a Nest.JS developer, I'd like the possibility of making an event-driven system using the framework decorators and module system.
References:
Describe the solution you'd like
I'm not sure about the internals, but I imagine something like this:
than, I'd like to bind class methods to events:
and also should be able to emit these events, something like:
Describe alternatives you've considered
At the moment, the alternative I have considered is to make an
EventEmitter
module, which manages queues and subscriptions usingDeno.Kv
queues, to keep it as native as possible.This is not ideal, but it can work if we set the
(un)subscription
inonAppBootstrap
andonAppClose
respectively.The text was updated successfully, but these errors were encountered: