quasar
quasar copied to clipboard
Fiber-Blocking Priority Queue
This is a feature request for a priority queue that is fiber-blocking.
It should be modelled after the PriorityBlockingQueue
except that the take
method would block on a fiber. (If bounded, then the put
method would block on a fiber as well.)
This might be best implemented as an extension to the Channels API.
Relevant discussion on the forum/mailing list is here.
According to the newChannel
method of the Channels
class:
Some combinations of properties are unsupported, and will throw an
IllegalArgumentException
if requested:
- unbounded channel with multiple consumers
Is this due to a technical limitation of Channels
in general that would also affect some future "PriorityChannel" implementation?
Whether or not we should add a priority-channel is a separate issue. First, we need a plain PriorityBlockingQueue
.