Loading RustViz Engine...
Block producers when consumer buffer is full using std::sync::mpsc::sync_channel.
This problem is currently in blueprint template mode. Once the concept foundation is finalized, live in-browser WebAssembly compilation and test assertion runners will be enabled here.
use std::sync::mpsc::sync_channel;
pub fn backpressure_pipeline(buffer_size: usize) {
let (tx, rx) = sync_channel(buffer_size);
// When buffer fills, tx.send() blocks until rx.recv() frees a slot
let _ = (tx, rx);
}