Read single output from an array of inputs - channels with priorities
|Latest on Hackage:||0.1|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
Abbreviation for the
PriorityChansConverger is PCC.
STM.TChan, extended with capacity control.
Wrapped into IO version is also available.
When user reads from the PCC, the choice is made - from which channel to read. System selects a nonempty channel, whose (CurrentPriority, StartPriority) tuple is max. The side effect of the channel selection is it's CurrentPriority decrease by one, if it's value becomes less than one, then the CurrentPriority is set to StartPriority.
For the main API interface:
The realization probably isn't
very fast and isn't good at memory economy, since it uses fresh high
level primitive - STM. It wasn't intended to be used
with millions of channels. But it's max throughput comparing to the
Chan throughput is to be estimated (will do it in some