question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I only process Jobs with a specific name?

See original GitHub issue

Hi, in Bull you had “Named jobs”, so you could give a job a name (like you can in BullMQ) but the difference is, that in Bull you were able to only process jobs with a specific name, e.g.

const myJob = await transcoderQueue.add('image', { input: 'myimagefile' });
transcoderQueue.process('image', processImage);

Is this possible in BullMQ as well? I looked into the Worker Class and its types, but were not able to find a similar feature, am I overlooking something?

My setup is something like this: Multiple Workers that run on different processes and each Worker being responsible for one “Shard” (they all do the same but on different resources). Now other instances calculate what shard has to get the job, and then add that job with the shard id as name, so only the Worker responsible for that Shard would get the Job. This was possible in Bull, but as it seems isn’t in BullMQ.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
manastcommented, Dec 23, 2020

@joeyfigaro there is nothing to update really… Names are just convenience sugar, there are no hidden functionality around them. If you have a specific use-case that cannot be addressed today it is better to create a new feature request. I will close this issue now to avoid confusion as if there is something more to do in it.

0reactions
manastcommented, Feb 2, 2021

The second link is for older bull. This has been slightly changed in BullMQ so that it does not create more confusion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Job Searching with a Chosen/Preferred Name
Sometimes, we just don't want to deal with it, and go through a job search process using our legal name even if it's...
Read more >
Set a name for background job manually
Background jobs will be created by system only, we cannot make any name changes to them. But when the process chain is running...
Read more >
Linux find process by name
Procedure to find process by name on Linux · Open the terminal application. · Type the pidof command as follows to find PID...
Read more >
Choose when to run jobs - GitLab Docs
Only the tag or branch name can be matched by a regular expression. The repository path, if given, is always matched literally. To...
Read more >
15.1. Job Control Commands
It is all too easy to confuse jobs and processes. Certain builtins, such as kill, disown, and wait accept either a job number...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found