Crate channel

source ·
Expand description

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::diem_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).

Modules

  • diem_channel provides an mpsc channel which has two ends diem_channel::Receiver and diem_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

Structs

Functions

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