Module backpressure

Module backpressure 

Source
Expand description

Backpressure and flow control utilities.

This module provides utilities for managing data flow between producers and consumers with backpressure.

§Overview

The Backpressure controller provides two complementary mechanisms:

  1. Buffer size tracking: Track how much data is buffered and block when full. Use try_acquire, acquire, and release for this.

  2. Concurrent operation limiting: Limit the number of concurrent operations using semaphore-based permits. Use try_acquire_permit and acquire_permit for this.

Structs§

Backpressure
A backpressure controller for limiting data flow and concurrent operations.
RateLimiter
A rate limiter for controlling operation frequency.
TokenBucket
A token bucket for rate limiting with bursts.