Code Monkey home page Code Monkey logo

Comments (5)

WonderPanda avatar WonderPanda commented on May 18, 2024

Are you referring to Singleton, Request or Transient Scopes in the context of the Discovery Service?

from nestjs.

jasperblues avatar jasperblues commented on May 18, 2024

Are you referring to Singleton, Request or Transient Scopes in the context of the Discovery Service?

Yes wondering if possible to know the scope of discovered providers or controllers?

I believe the data is in the underlying NestJS framework. This is a fantastic library btw! The same code without the library gets quite tedious.

from nestjs.

WonderPanda avatar WonderPanda commented on May 18, 2024

@jasperblues Sorry for the delayed response, I've been on vacation this past week. Currently it is only possible to discover Singleton services as the discovery service works by integrating with the Module Initialization lifecycle hook. During this time these are the only dependencies that can actually be resolved from the container.

Request scoped dependencies are explicitly filtered out because given the use case that this library supports it doesn't really make sense to get an instance of one. I'm open to the possibility of trying to expand functionality around non singleton dependencies though if there's new and interesting use cases that this would open up.

I'm glad you're enjoying the library so far, do you mind expanding a bit on what you're currently using it for and how accessing these other scopes might be helpful?

from nestjs.

WonderPanda avatar WonderPanda commented on May 18, 2024

@jasperblues I'm going to close this for now. Feel free to continue the conversation from my previous comment

from nestjs.

jasperblues avatar jasperblues commented on May 18, 2024

@jasperblues Sorry for the delayed response, I've been on vacation this past week. Currently it is only possible to discover Singleton services as the discovery service works by integrating with the Module Initialization lifecycle hook. During this time these are the only dependencies that can actually be resolved from the container.

I wanted to ensure that my decorator based job scheduler only applied to singletons, so this meets my needs. Thanks a lot for the response, and again for the excellent library.

from nestjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.