Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Named processors #24

Closed
ejhayes opened this issue Aug 27, 2021 · 5 comments
Closed

Named processors #24

ejhayes opened this issue Aug 27, 2021 · 5 comments
Labels
wontfix This will not be worked on

Comments

@ejhayes
Copy link
Owner

ejhayes commented Aug 27, 2021

I'm submitting a...


[x] Regression 
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

If using this library and you have:

@Process({
  name: 'NAMED_JOB_1',
  concurrency: 5,
})
async processSomeJob1(job: Job<any>): Promise<void> {
  // logic here
}

@Process({
  name: 'NAMED_JOB_2',
  concurrency: 5,
})
async processSomeJob2(job: Job<any>): Promise<void> {
  // logic here
}

Then both functions will get called regardless of the job name passed in.

Expected behavior

Specifying a named job should result in the correct processor being used. This functionality currently exists with the nestjs/bull package.

Minimal reproduction of the problem with instructions

The following should work:

@Process({
  name: 'A_NAMED_JOB',
  concurrency: 5,
})
async processSomeJob(job: Job<any>): Promise<void> {
  // logic here
}

What is the motivation / use case for changing the behavior?

Making this work would help ensure that this library remains a drop in replacement for the nestjs/bull package.
taskforcesh/bullmq#448 (comment)

Functionality wise, Bullv3 and BullMQ provides the same, it just that the syntax is different. In BullMQ you only define 1 processor, and then inside the processor you can choose different code paths depending on the "job.name" property. In your case this will mean a bit more of code, but named processors where causing a lot of confusion so we decided to remove the syntax sugar and made it more explicit.

Environment


For Tooling issues:
- Node version: 12
- Platform:  Mac
@brianschardt
Copy link

Any updates on when this will be fixed? or looked at?

@ejhayes
Copy link
Owner Author

ejhayes commented Oct 14, 2021

@brianschardt might be a couple weeks until I have bandwidth for this. Seems like it should be an easy fix though. PRs welcome!

@stale
Copy link

stale bot commented Dec 13, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Dec 13, 2021
@stale
Copy link

stale bot commented Dec 20, 2021

This issue has bee marked as stale for too long. If you feel like it has not and should still be resolved, feel free to comment.

@stale stale bot closed this as completed Dec 20, 2021
@bilalshaikh42
Copy link

Hi,
Is this something that you plan on working on?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants