evaluateTokenBucketRateLimitTransition()
Evaluate one D650 token-bucket-v1 transition with integer rational refill.
See {@link evaluateFixedWindowRateLimitTransition} for the mandatory receipt-first durable host ordering. No IEEE floating-point token accumulation is used; saturation discards excess credit and remainder, and a valid denial still advances the returned refill state.
Import
Section titled “Import”import { evaluateTokenBucketRateLimitTransition } from "@graphrefly/ts/rate-limit";Signature
Section titled “Signature”function evaluateTokenBucketRateLimitTransition(value: unknown): TokenBucketRateLimitTransitionParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | unknown | Strict token-bucket request, policy, state, and supplied observation input. |
Returns
Section titled “Returns”One immutable ready transition with integer-rational nextState.
Example
Section titled “Example”import { evaluateTokenBucketRateLimitTransition } from "@graphrefly/ts/rate-limit";Source
Section titled “Source”packages/ts/src/rate-limit/keyed-rate-limit-algorithms.ts