je_load_density.utils.throttle.rps_throttle

Per-key RPS throttle.

Token-bucket limiter that caps the request rate for a named bucket. Buckets are shared by name so multiple tasks (or workers in the same process) can coordinate on the same cap.

Functions

get_throttle(key, rps[, burst])

Return the shared throttle for key; create it on first call.

reset_throttles()

Classes

RpsThrottle(rps[, burst])

Token-bucket throttle.

class je_load_density.utils.throttle.rps_throttle.RpsThrottle(rps: float, burst: int | None = None)

Bases: object

Token-bucket throttle. acquire blocks until one token is available, then consumes it.

acquire() None
je_load_density.utils.throttle.rps_throttle.get_throttle(key: str, rps: float, burst: int | None = None) RpsThrottle

Return the shared throttle for key; create it on first call. Subsequent calls ignore later rps / burst arguments — clear with reset_throttles() to reconfigure.

je_load_density.utils.throttle.rps_throttle.reset_throttles() None