-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Handle results from promises from seprate processors #2220
Comments
Strange, we have a test case that cover this: https://github.com/OptimalBits/bull/blob/develop/test/test_sandboxed_process.js#L38 |
But if i return a normal statement |
Since you are using "async" already, then what you are returning is a promise not the value of the promise. |
Ahh shit, I forgot about the |
Not needed. |
I mean, you need to return a promise, either using async or a promise from a promise chain or whatever. |
But the above implementation the |
Because you are not returning any promise. The promise that you are returning is for the callback in ProcessImage... |
The code should be like this: module.exports = function (job) {
return new Promise((resolve, reject) => {
ProcessImage(job.data, (err, result) => {
if (err) {
reject(err);
} else {
resolve({ status: "success" });
}
});
});
}; |
Thanks now its working |
Description
I am trying to implement a queue as a separate processor
In
process-queue.js
i m handlingBut on the queue
completed
event I can't read the results from the promise which I return from the processorBull version :4.1.1
The text was updated successfully, but these errors were encountered: