Replies: 1 comment
-
|
Hey! You are right that DelayQueue in Java primarily uses the getDelay method to determine order. In openTCS, the priority value you see (passed as 3) is often used as a hint or for specific scheduling strategies in the kernel, but it might not be the primary sorting key for that specific queue. If the base class compareTo implementation only checks the expiration time, then the priority will not change the order in the DelayQueue. The priority is likely there for other parts of the system that process these tasks or for future-proofing. If you need priority-based sorting, the compareTo method would need to be overridden to consider both delay and priority. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
May I ask if the priority here is not used in the delay queue? I haven't seen any code that sorts the delay queue based on this priority.
Beta Was this translation helpful? Give feedback.
All reactions