Skip to main content

Module rate_limit

Module rate_limit 

Source
Expand description

Provider-neutral quota, rate-limit, and retry-delay domains.

Structs§

DelayDecision
Pure bounded delay decision. The caller owns sleeping and clock acquisition.
DelaySeconds
A relative delay measured in whole seconds.
HttpDate
A parsed HTTP date represented as signed Unix seconds.
QuotaBucket
One coherent provider quota bucket.
QuotaBucketId
Provider-defined quota bucket identity in fixed-capacity storage.
QuotaBuckets
Fixed-capacity set of distinct provider quota buckets.
QuotaDelayPolicy
Caller-owned quota delay policy.
QuotaExtension
Bounded informational quota extension.
RateLimit
Legacy single-bucket rate-limit metadata.
WallClockTimestamp
An absolute Unix wall-clock timestamp in whole seconds.

Enums§

DelayConflictPolicy
Conflict policy when Retry-After and exhausted quota buckets disagree.
DelayDecisionError
Failure to derive an unambiguous bounded delay.
DelaySource
Metadata source selected for a delay decision.
ExcessDelayPolicy
Handling for a computed delay above the caller’s maximum.
PastTimestampPolicy
Handling for timestamps at or before the caller’s observation time.
QuotaError
Invalid quota bucket or bounded collection.
QuotaExtensionError
Invalid informational quota extension.
QuotaReset
Reset semantics for one provider quota bucket.
RateLimitError
Rate-limit metadata validation error.
RetryAfter
Standard HTTP Retry-After value.
RetryAfterError
Invalid Retry-After syntax or value.

Constants§

MAX_QUOTA_BUCKETS
Maximum provider quota buckets retained from one response.
MAX_QUOTA_BUCKET_ID_BYTES
Maximum exact-byte provider quota bucket identity length.
MAX_QUOTA_EXTENSIONS_PER_BUCKET
Maximum informational extensions retained per quota bucket.
MAX_QUOTA_EXTENSION_NAME_BYTES
Maximum exact-byte quota extension name length.
MAX_QUOTA_EXTENSION_VALUE_BYTES
Maximum exact-byte quota extension value length.

Functions§

decide_delay
Derives a bounded delay without reading a clock or sleeping.