| Crates.io | re_quota_channel |
| lib.rs | re_quota_channel |
| version | 0.29.0-alpha.7 |
| created_at | 2026-01-22 13:54:16.989146+00 |
| updated_at | 2026-01-23 15:24:19.725947+00 |
| description | A channel that applies backpressure based on byte size. |
| homepage | https://rerun.io |
| repository | https://github.com/rerun-io/rerun |
| max_upload_size | |
| id | 2061675 |
| size | 65,366 |
Part of the Rerun project.
A mpsc channel that applies backpressure based on byte size.
This crate provides a multi-producer, single-consumer channel that limits throughput based on the total byte size of messages in the channel, rather than just the number of messages.
When the byte capacity is exceeded:
send method blocks until space is availableuse re_quota_channel::channel;
// Create a channel with 1MB capacity
let (tx, rx) = channel::<Vec<u8>>("my_channel", 1_000_000);
// Send a message with its size
let data = vec![0u8; 1000];
tx.send(data.clone()).unwrap();
// Receive the message
let received = rx.recv().unwrap();
If a message is larger than the total channel capacity, a warning is logged and the channel waits until it's completely empty before sending (to minimize memory usage).