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 MemoryRateLimitStore: (source)
Constructor: MemoryRateLimitStore(max_keys, max_events)
Undocumented
| Method | __at |
Report whether admitting a new client would exceed either bound. |
| Method | __gc |
Inspect the next group of keys and remove expired buckets. |
| Method | __hit |
Update quota and capacity counters while holding the store lock. |
| Method | __init__ |
Initialize an empty rate-limit store. |
| Method | __new |
Create a bucket only when bounded reclamation makes room for it. |
| Async Method | hit |
Record a request attempt and decide whether it is allowed. |
| Constant | _GC |
Undocumented |
| Constant | _GC |
Undocumented |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | __keys |
Undocumented |
| Instance Variable | __lock |
Undocumented |
| Instance Variable | __max |
Undocumented |
| Instance Variable | __max |
Undocumented |
| Instance Variable | __storage |
Undocumented |
| Instance Variable | __ticks |
Undocumented |
| Instance Variable | __total |
Undocumented |
Report whether admitting a new client would exceed either bound.
| Returns | |
bool | Whether client or timestamp capacity is exhausted. |
Record a request attempt and decide whether it is allowed.
Implements a sliding window over accepted attempts. Inactive keys are reclaimed incrementally during subsequent attempts, including rejected attempts. Each key should use a consistent window. A lock serializes updates across event loops and threads. Capacity exhaustion rejects attempts without evicting active quotas or retaining rejected clients.
| Parameters | |
key:str | Unique identifier for the rate-limited entity (e.g. IP, user id, route). |
limit:int | Maximum number of requests allowed within window. |
window:int | Length of the sliding window in seconds. |
| Returns | |
bool | True when the request is within the limit, False when the quota is exceeded. |