THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class documentation
class RedisRateLimitStore: (source)
Constructor: RedisRateLimitStore(config, client)
Share sliding-window quotas using a single-key atomic Redis script.
| Method | __init__ |
Build a lazy Redis connection, optionally using an external client. |
| Async Method | close |
Close connections created by this store without deleting quotas. |
| Async Method | hit |
Accept an attempt only when its distributed sliding quota permits. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | __client |
Undocumented |
| Instance Variable | __owns |
Undocumented |
| Instance Variable | __prefix |
Undocumented |
| Instance Variable | __timeout |
Undocumented |
Build a lazy Redis connection, optionally using an external client.
| Parameters | |
config:HTTPRateLimit | Validated connection URL, namespace and operation timeout. |
client:Redis | None, optional | Externally owned transport. The caller remains responsible for it. |
| Returns | |
None | Prepare the backend without opening a network connection. |
Close connections created by this store without deleting quotas.
| Returns | |
None | Release an owned client's connection pool. |
Accept an attempt only when its distributed sliding quota permits.
| Parameters | |
key:str | Client identity. Only its SHA-256 digest is persisted in Redis. |
limit:int | Maximum accepted attempts in the window. |
window:int | Window duration in seconds, consistent across all workers. |
| Returns | |
bool | Whether Redis atomically accepted the attempt. |
| Raises | |
redis.exceptions.RedisError | When storage is unavailable or contains an incompatible key type. |