-
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
When is resolved the Queue.process promise ? #1688
Comments
in theory when the queue is closed. |
Could the method be synchronous or resolve directly? Reason I'm asking is, typescript-eslint doesn't like ignoring the returned promise: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-floating-promises.md (Although, as a workaround, it's simple to just disable the rule in place) |
Return synchronously is not a real solution maybe under the hood there is a reason for the Promise. I think you can manage the promise like my example (don't wait for it) and just don't expect to see the debug! If that sounds to you like an hack maybe we can ask another version (sync) of the |
I guess it's really a question of API design. Currently running It might be more intuitive to separate that eg. specify the handler in the Currently, attaching a 'then' or 'catch' to the call to
|
This caught me by surprise aswell, it wasn't really clear to me that It would make it easier to grok when there are seperate methods, something like; |
yes. there are plans to improve the logic. In BullMQ for instance, the process is specified in the Worker constructor, so it is less confusing, however the processor starts processing directly after instantiating the worker, which is less code to type but more magic, which is not always good. |
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. |
Hi, this is a question:
Is not clear for me when the returned promise from
Queue.process
is resolved, the process function is well documented but is not clear how to manage the process function return itself. If I write something like that:I don't event see the console log output!
The text was updated successfully, but these errors were encountered: