Crates.io | stochastic-queue |
lib.rs | stochastic-queue |
version | 0.2.0 |
source | src |
created_at | 2023-03-28 12:21:09.495206 |
updated_at | 2023-04-24 22:59:35.745417 |
description | Queue and MPMC channel that pops in a random order |
homepage | https://github.com/wilsonzlin/stochastic-queue |
repository | https://github.com/wilsonzlin/stochastic-queue.git |
max_upload_size | |
id | 822984 |
size | 11,705 |
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.