Skip to main content

Module queue

Module queue 

Source
Expand description

A queue with three priority levels. A sender can be shared by reference across threads, while cloning a receiver adds another consumer of the same queue.

When more than one level has items, each pop chooses a level at random in proportion to its Priority::weight: high 60, medium 30 and low 10. Items retain FIFO order within a level; the queue itself is unbounded.