[][src]Crate channel

Provides an mpsc (multi-producer single-consumer) channel wrapped in an IntGauge that counts the number of currently queued items. While there is only one [channel::Receiver], there can be many [channel::Sender]s, which are also cheap to clone.

This channel differs from our other channel implementation, [channel::libra_channel], in that it is just a single queue (vs. different queues for different keys) with backpressure (senders will block if the queue is full instead of evicting another item in the queue) that only implements FIFO (vs. LIFO or KLAST).



libra_channel provides an mpsc channel which has two ends libra_channel::Receiver and libra_channel::Sender similar to existing mpsc data structures. What makes it different from existing mpsc channels is that we have full control over how the internal queueing in the channel happens and how we schedule messages to be sent out from this channel. Internally, it uses the PerKeyQueue to store messages




An mpsc::Receiver with an [IntGauge] counting the number of currently queued items.


An mpsc::Sender with an [IntGauge] counting the number of currently queued items.



Similar to mpsc::channel, new creates a pair of Sender and Receiver