GithubHelp home page GithubHelp logo

Comments (21)

codetheweb avatar codetheweb commented on April 19, 2024 7

Feel free to check out #720 if you want to test bullmq.

from bull.

kamilmysliwiec avatar kamilmysliwiec commented on April 19, 2024 2

Thank you for sharing your thoughts.

@Queue('example', { ...other queue options })

This decorator looks promising. A way to declaratively define a queue would be nice.

... extends AbstractQueue {
  
  // provided by AbstractQueue for full queue control if needed
  private readonly queue: BullQueue;

Using DI with @InjectQueue seems to be more testable & cleaner in comparison to the proposed approach (with inheritance and abstract classes).

// Job decorator creates a job and adds it to bull queue
  // with data returned from the method
  @Job()
  async task1(param1: string, param2: number): Promise<Task1Data> {
    return {
      param1,
      param2
    }
  }

I'm not sure what would be the potential use-case for statically created one-time jobs that are added to the queue on application bootstrap and how - most importantly - this decorator simplifies this operation (instead of simply calling .add() explicitly).

// RepeatableJob decorator allows to automatically register the job
  // in the bull queue and acts as a guard to disallow calling method
  @RepeatableJob({
    repeat: { cron: '* * * * *' },
    attempts: 1,
  })

This looks great though. I'm guessing having @Job would be nice for the sake of consistency then?

@Process(ExampleQueue.task1)

This is impossible. task1 would have to be defined as a static method which doesn't make any sense.

async task2(data: Task2Data, @InjectJob() job: Job<Task2Data>) 

I'm not a big fan of this decorator either. I think we can just pass 2 arguments by default (job would be optional in this case).

from bull.

PaulMest avatar PaulMest commented on April 19, 2024 2

I might be late to this thread, but I found this BullMQ blog post helpful to talk about how BullMQ is really the same team and just the next gen of bull: https://medium.com/@rockstudillo/beta-release-of-bullmq-4-0-867960aec51.

from bull.

main-kun avatar main-kun commented on April 19, 2024 2

@stavalfi Are there issues in bullmq repo for those bugs or any other evidence? I'm preparing a PR for the switch for this repo so i'd love to know more

from bull.

stavalfi avatar stavalfi commented on April 19, 2024 2

as i remember, there is no such issue. i will try to find a time in the next 2-3 days to reproduce it in small repo.

from bull.

panki avatar panki commented on April 19, 2024

hi, @kamilmysliwiec , thank you for your response, I have some thoughts and suggestions based on your feedback, but I'm in the middle of moving out, please don't close this issue, I'll write my comments at the end of next week.

from bull.

gperdomor avatar gperdomor commented on April 19, 2024

@kamilmysliwiec this package sound great... One question off topic, why this use the old bullpackage instead the new bullmq?

from bull.

VictorGaiva avatar VictorGaiva commented on April 19, 2024

BullMq, which is the Beta repo for Bull 4.0, is available. I believe that any changes to this API should be built on top of the newer version.

from bull.

gperdomor avatar gperdomor commented on April 19, 2024

@VictorGaiva well i think BullMQ was released under v1 and not as v4... The latest release is 1.6.7 from 6 days ago... https://github.com/taskforcesh/bullmq/releases

from bull.

fwoelffel avatar fwoelffel commented on April 19, 2024

@gperdomor I believe BullMQ is actually Bull 4.

@VictorGaiva Good catch. Maybe we should keep this in mind: https://docs.bullmq.io/bull-3.x-migration/compatibility-class

from bull.

gperdomor avatar gperdomor commented on April 19, 2024

@fwoelffel yes, agreed

from bull.

VictorGaiva avatar VictorGaiva commented on April 19, 2024

@fwoelffel It seems to be. I found the repo directly from main README:

BullMQ 4 Beta

If you want to start using the next major version of Bull you are welcome to the new repo here

from bull.

brianschardt avatar brianschardt commented on April 19, 2024

any updates here?

from bull.

VictorGaiva avatar VictorGaiva commented on April 19, 2024

@brianschardt You can feel free to contribute in any way to the repo. We need someone to kickstart it

from bull.

twister21 avatar twister21 commented on April 19, 2024

The proposed cronjob abstraction is far better than the current workaround.
I have to implement the OnApplicationBootstrap interface myself to enqueue the job after Nest's initialization is completed.

onApplicationBootstrap(): void {
  this.userCleanupQueue.add(null, { repeat: { cron: "0 1 * * *" } });
}

from bull.

stavalfi avatar stavalfi commented on April 19, 2024

bullmq is not production ready. sometimes jobs are not processes. the reproduction is not that easy and i don't have time for it but there are problems. bullmq needs more time.

from bull.

vh13294 avatar vh13294 commented on April 19, 2024

Any update on this ?

I am happy to beta test the new version.

from bull.

stavalfi avatar stavalfi commented on April 19, 2024

sorry, don't wait for me. I don't have time to reproduce this. and maybe by now they already fixed the bug I faced.

from bull.

michael-land avatar michael-land commented on April 19, 2024

Any plan move to bullmq?

from bull.

Pietrox avatar Pietrox commented on April 19, 2024

@xiaoyu-tamu #754

There is a pretty fresh mention from @kamilmysliwiec on what may happen.
But honestly, if you use @nestjs/bull + bullmq instead of the bull it should work. I didn't test all the features but "Queue" class seems to work on the most of the features. And that is from last 2 weeks when I spent it on writting a queue feature in Nestjs project.

from bull.

kamilmysliwiec avatar kamilmysliwiec commented on April 19, 2024

#720 (comment)

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.