re_quota_channel

Crates.iore_quota_channel
lib.rsre_quota_channel
version0.29.0-alpha.7
created_at2026-01-22 13:54:16.989146+00
updated_at2026-01-23 15:24:19.725947+00
descriptionA channel that applies backpressure based on byte size.
homepagehttps://rerun.io
repositoryhttps://github.com/rerun-io/rerun
max_upload_size
id2061675
size65,366
rerun.io (rerunio)

documentation

README

re_quota_channel

Part of the Rerun project.

Latest version Documentation MIT Apache

A mpsc channel that applies backpressure based on byte size.

Overview

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:

  • Native platforms: The send method blocks until space is available
  • WebAssembly: Blocking is not possible, so a warning is logged and the message is sent anyway

Usage

use 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();

Special cases

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

Commit count: 4053

cargo fmt