#order #queue #channel #mpmc #random #pops

stochastic-queue

Queue and MPMC channel that pops in a random order

3 unstable releases

0.2.0 Apr 24, 2023
0.1.1 Mar 29, 2023
0.1.0 Mar 28, 2023

#1259 in Concurrency

22 downloads per month
Used in 3 crates

Apache-2.0

12KB
209 lines

stochastic-queue

A queue and MPMC channel that pops items in a uniformly random order, instead of FIFO. Useful for nondeterminism, such as simulating chaos for testing or picking branches unpredictably.

Because there is no predetermined order, it's not possible to peek or iterate the queue. An item will always be popped if at least one is present in the queue.

Check the docs for usage guides and examples.

Dependencies

~310KB