ORIONIS API REFERENCE

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)

View In Hierarchy

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_client Undocumented
Instance Variable __prefix Undocumented
Instance Variable __timeout Undocumented
def __init__(self, config: HTTPRateLimit, *, client: Redis | None = None): (source)

Build a lazy Redis connection, optionally using an external client.

Parameters
config:HTTPRateLimitValidated connection URL, namespace and operation timeout.
client:Redis | None, optionalExternally owned transport. The caller remains responsible for it.
Returns
NonePrepare the backend without opening a network connection.
async def close(self): (source)

Close connections created by this store without deleting quotas.

Returns
NoneRelease an owned client's connection pool.
async def hit(self, key: str, limit: int, window: int) -> bool: (source)

Accept an attempt only when its distributed sliding quota permits.

Parameters
key:strClient identity. Only its SHA-256 digest is persisted in Redis.
limit:intMaximum accepted attempts in the window.
window:intWindow duration in seconds, consistent across all workers.
Returns
boolWhether Redis atomically accepted the attempt.
Raises
redis.exceptions.RedisErrorWhen storage is unavailable or contains an incompatible key type.
__slots__: tuple[str, ...] = (source)

Undocumented

__client = (source)

Undocumented

__owns_client = (source)

Undocumented

__prefix = (source)

Undocumented

__timeout = (source)

Undocumented