-
Notifications
You must be signed in to change notification settings - Fork 102
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
Better API proposal & move to BullMQ #202
Comments
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 // 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 // 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 @Process(ExampleQueue.task1) This is impossible. 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 ( |
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. |
This comment has been minimized.
This comment has been minimized.
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. |
@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 |
@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 |
@fwoelffel yes, agreed |
@fwoelffel It seems to be. I found the repo directly from main README:
|
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. |
any updates here? |
@brianschardt You can feel free to contribute in any way to the repo. We need someone to kickstart it |
The proposed cronjob abstraction is far better than the current workaround.
|
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. |
@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 |
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. |
Any update on this ? I am happy to beta test the new version. |
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. |
Feel free to check out #720 if you want to test bullmq. |
Any plan move to bullmq? |
@xiaoyu-tamu #754 There is a pretty fresh mention from @kamilmysliwiec on what may happen. |
I'm submitting a better api proposal
I think the value that this library brings to developers may be significantly improved. Please, take a look at the API proposal below:
example.types.ts
example.queue.ts
example.processor.ts
example.module.ts
What is the motivation/use case for changing the behavior?
In my opinion, using API like this allows to:
I can describe exact responsibilities for each of the decorators:
@Queue
,@Job
,@Processor
,@Process
,@InjectJob
but first I would like to hear your opinion about this in general.The text was updated successfully, but these errors were encountered: