Git Product home page Git Product logo

Comments (9)

maksimkurb avatar maksimkurb commented on May 2, 2024 3

Yes, I think so. With #116 it will be a better solution.

Leaving a sample of shared module for anyone who is interested:

const QueueModule = BullModule.forRoot({ // BullModule.register
  name: 'test',
});

@Module({
  imports: [QueueModule],
  exports: [QueueModule],
})
export class SharedModule {}

from bull.

fwoelffel avatar fwoelffel commented on May 2, 2024

Hi @maksimkurb and thanks for reporting.
Was your sample working before NestJS 6.3.1?

from bull.

maksimkurb avatar maksimkurb commented on May 2, 2024

Sorry, did an example in a hurry, so I made some mistakes. Now I updated it and this is correct, that it is not working on NestJS 6.3.1, but working fine on NestJS 6.3.0

from bull.

maksimkurb avatar maksimkurb commented on May 2, 2024

@fwoelffel, I got it! We should add @Global() decorator to BullModule so we can use queue in other modules. Another option is to create method BullModule.forFeature() like in TypeORM module, but this will be a breaking change.
I will create a pull request in a couple of minutes

from bull.

fwoelffel avatar fwoelffel commented on May 2, 2024

I think having a SharedModule that exports your queue, and that is imported in whichever modules where you need the queue to be injected, could solve your issue.
Would you try that? I'd prefer not to increase the code complexity as long as this can be avoided.

from bull.

fwoelffel avatar fwoelffel commented on May 2, 2024

I really don't like the Global solution 😉

from bull.

maksimkurb avatar maksimkurb commented on May 2, 2024

SharedModule is also the solution, but then forRoot method name is confusing. Better to be called register like in HttpModule

from bull.

fwoelffel avatar fwoelffel commented on May 2, 2024

I understand that. I think the real issue here is the lack of documentation/examples.

Anyway, should we close this issue?

from bull.

ofebles avatar ofebles commented on May 2, 2024

I need create sessions for handle queues of inline clients, when creating a new session, I need to create a new queue with session name (dynamic) , but in nestjs docs you always know the queue name for registering and later inject it . How i can manage the dynamic creation of bull queues in nestjs?

from bull.

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.