Closed mengzhisy closed 2 months ago
There is no fairness guaranteed. What's happening here is that the consumer threads are each reenqueueing to an implicit producer queue specific to their thread. These implicit inner queues happen to be polled for elements before the one from main, in perpetuity.
Using explicit consumer tokens will improve fairness, but again, nothing is guaranteed.
Using explicit consumer tokens will improve fairness, but again, nothing is guaranteed.
Great, this solved my problem. Thank you very much!
This is a great project, and it has been in use in our production environment for some time. However, we recently discovered an issue where the behavior of the queue is not quite consistent with my initial understanding.
As shown in the output above, elements 10 to 32 cannot be consumed in time. I don't have strict requirements on the execution order, but I don't want elements to wait in the queue for too long without being consumed. Do you have any suggested solutions?