#channel #queue #sender #key #receiver #fifo #blockchain

yanked aptos-channel

An implementation of a channel with configurable QoS

0.2.7 Aug 16, 2022
0.2.6 Aug 13, 2022
0.2.2 Jul 22, 2022
0.1.7 Jul 9, 2022
0.1.0 May 27, 2022

#42 in #receiver

Download history 7/week @ 2024-03-28 3/week @ 2024-04-04 123/week @ 2024-07-04 21/week @ 2024-07-11

144 downloads per month
Used in 36 crates (14 directly)

Apache-2.0

58KB
1.5K SLoC

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 Receiver, there can be many Senders, which are also cheap to clone.

This channel differs from our other channel implementation, aptos_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).

Dependencies

~2–7.5MB
~58K SLoC