Get a Consumer which makes it possible to read items from the queue. Can be called multiple times. The resulting Consumer is not thread-safe, so you have to use multiple Consumers of the same queue to simultaneously write from multiple coroutines/threads.
Get a MultiConsumer which makes it possible to read items from the queue. Can be called multiple times. The resulting MultiConsumer is thread-safe, so it can be used simultaneously from multiple coroutines/threads.
Note
MultiConsumer may outlive the queue and producers.
Prefer Consumer tokens when possible, because MultiConsumer token incurs some overhead.
Get a MultiProducer which makes it possible to push items into the queue. Can be called multiple times. The resulting MultiProducer is thread-safe, so it can be used simultaneously from multiple coroutines/threads.
Note
MultiProducer may outlive the queue and consumers.
Prefer Producer tokens when possible, because MultiProducer token incurs some overhead.
Get a Producer which makes it possible to push items into the queue. Can be called multiple times. The resulting Producer is not thread-safe, so you have to use multiple Producers of the same queue to simultaneously write from multiple coroutines/threads.