Allow to create a processor in separate file (or server) for a specific job name in single queue.
// producer.js
queue.add('foo', {});
queue.add('bar', {});
// worker-both.js
queue.process('foo', fooFunc)
queue.process('bar', barFunc)
// worker-only-foo.js
queue.process('foo', fooFunc)
The error Missing process handler for job type is raised in the worker-only-foo.js file.
3.3.8
I don't want to launch jobs with name bar on some servers but I'd like to launch jobs with both names on some servers.
Unfortunately that is not possible to achieve with current design, the workaround is to define 2 queues instead of only one.
it is not good
any solution except multiple queues?
you can use * for the job name and the the processor will catch all the jobs independently of names, I don't know if that is useful for you or not...
My task is:
// producer.js
queue.add('foo', {});
queue.add('bar', {});
Usual worker.
// worker-1.js
queue.process('*', fooFunc)
Worker to help with foo tasks.
// worker-2.js
queue.process('foo', fooFunc)
that will not work unfortunately with current queue design :/
Is this supported @manast.
Most helpful comment
it is not good