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::Senders, 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
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
message_queues

Structs§

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

Functions§

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