Skip to main content

Module backpressure

Module backpressure 

Source
Expand description

Backpressure handling for write operations.

This module provides backpressure management to prevent memory exhaustion when the write side is slower than the producer side. It tracks pending frames and provides mechanisms to limit the number of in-flight writes.

§Usage

The BackpressureController is used internally by the writer task to track pending writes. Handlers interact with backpressure through the WriterHandle which will automatically wait or reject when backpressure is active.

§Configuration

  • max_pending: Maximum number of pending frames (default: 1024)
  • Timeout: How long to wait when backpressure is active (default: 5s)

Structs§

BackpressureController
Backpressure controller for managing write queue pressure.
BackpressureGuard
Guard that automatically releases a backpressure slot on drop.

Constants§

DEFAULT_MAX_PENDING
Default maximum pending frames before backpressure kicks in.
DEFAULT_TIMEOUT
Default backpressure timeout (how long to wait for space to become available).