You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Priorities goes from 1 to MAX_INT, whereas lower number is always higher priority than higher numbers.
Most frameworks or libraries that I've worked with always followed the pattern that a higher priority = higher number, in other words priority: 10 is a higher priority than priority: 2.
BullMQ seems to do it the other way around, which is illogical because now we can use mathematical equivalence to simply generate numbers that are higher than 1 to increase priority of tasks. Instead, we have to start with MAX_INT which is the lowest priority.
This doesn't make much sense to me. Is it possible to make reverse how priorities are compared in a future version of bullmq? Or introduce a setting allowing us to switch the way priority is handled?
It is more logical and easier to reason about if the lower number corresponds to the lower priority, and the higher number to the higher priority.
Thanks,.
The text was updated successfully, but these errors were encountered:
Also, it is not clear from the documentation what the priority is of tasks where the priority is not specified. Is that MAX_INT? Has every job with a priority of < MAX_INT thus a higher priority than jobs without priority specified?
Again, this would be easier to reason about if a not specified priority would equal to priority 0 (e.g. empty, null, zero), and any number higher than that would correspond to a higher priority.
I understand you may be used to a different priority arrangement, but there is nothing illogical in arrange it the way it is in BullMQ. In Linux/Unix priorities also go from highest to lowest, starting at priority 0.
You can easily reverse it in user code if that is what you want...
From the documentation:
Most frameworks or libraries that I've worked with always followed the pattern that a higher priority = higher number, in other words
priority: 10
is a higher priority thanpriority: 2
.BullMQ seems to do it the other way around, which is illogical because now we can use mathematical equivalence to simply generate numbers that are higher than 1 to increase priority of tasks. Instead, we have to start with
MAX_INT
which is the lowest priority.This doesn't make much sense to me. Is it possible to make reverse how priorities are compared in a future version of bullmq? Or introduce a setting allowing us to switch the way priority is handled?
It is more logical and easier to reason about if the lower number corresponds to the lower priority, and the higher number to the higher priority.
Thanks,.
The text was updated successfully, but these errors were encountered: