Skip to content

common_rates.schemas.results

What a limiter reports: one admission, one quota’s standing, and the limiter itself.

Light, built by code we own, never carrying a secret or a payload.

Classes

Balance

One quota’s standing for a scope, as the backend last knew it.

replenishes_at is when a unit is next available: the window’s reset for a window quota, the next refill for an exhausted bucket, None when units remain.

__init__

def __init__(scope: Scope, quota: str, remaining: float, replenishes_at: datetime | None) -> None

Fields and properties declared here; inherited members belong to the bases above.

quota

quota: str

remaining

remaining: float

replenishes_at

replenishes_at: datetime | None

scope

scope: Scope

LimiterInfo

What a limiter is and where it stands; the info seam’s answer.

__init__

def __init__(backend: str, state: Literal['new', 'open', 'closed'], scopes: tuple[str, ...]) -> None

Fields and properties declared here; inherited members belong to the bases above.

backend

backend: str

scopes

scopes: tuple[str, ...]

state

state: Literal['new', 'open', 'closed']

Permit

One admission granted: what it cost, how long it waited, and which quota gated it.

__init__

def __init__(scope: Scope, cost: float, waited: float, gated_by: str | None, granted_at: datetime) -> None

Fields and properties declared here; inherited members belong to the bases above.

cost

cost: float

gated_by

gated_by: str | None

granted_at

granted_at: datetime

scope

scope: Scope

waited

waited: float