quasar icon indicating copy to clipboard operation
quasar copied to clipboard

Fiber-Blocking Priority Queue

Open voidstarstar opened this issue 8 years ago • 2 comments

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.

voidstarstar avatar Jun 03 '16 14:06 voidstarstar

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?

voidstarstar avatar Jun 03 '16 15:06 voidstarstar

Whether or not we should add a priority-channel is a separate issue. First, we need a plain PriorityBlockingQueue.

pron avatar Jun 06 '16 09:06 pron