It can be nice to have access of the NestContainer instance of the application on the modules
See original GitHub issueWith application container access, you can build modules that have annotations…
I am building a NestJS module that works with Kue, so in the application controllers I can have something like this to define a Task:
@Task({ name: 'justOneTest' })
justOneTest(done, task) {
console.log('Received task:', task);
setTimeout(done, 5000);
}
Then create a new job with:
kueService.create(this.justOneTest);
Issue Analytics
- State:
- Created 6 years ago
- Comments:18 (8 by maintainers)
Top Results From Across the Web
Custom providers | NestJS - A progressive Node.js framework
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines ...
Read more >What is the NestJS Runtime - Trilon Consulting
In case you're not familiar with NestJS, it is a TypeScript Node.js framework that helps you build enterprise-grade efficient and scalable Node.
Read more >Application context - NestJS - Netlify
Nest context is a wrapper around the Nest container, which holds all instantiated classes. We can grab an existing instance from within any...
Read more >Containerized development with NestJS and Docker
With a single command, nest new app-name , we have a fully functional, ready-to-go application. The generated setup is fine for a simple ......
Read more >Nestjs
Depending on which underlying platform we use, we will get access to its ... instance of any provider between multiple modules effortlessly.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have shared the code on https://github.com/erickponce/nestjs-kue feel free to use it.
Note that this is not tested on production environments, and there are improvements to be made =)
I changed the implementation to use
ModuleRef
accordingly to CQRS module and it works perfectly.Thank you @kamilmysliwiec 🙂