INNER CODE UNIT · Python
acquire_entry
alisaifee/limits · limits/aio/storage/redis/__init__.py:179
async def acquire_entry(
self, key: str, limit: int, expiry: int, amount: int = 1
) -> bool:
"""
:param key: rate limit key to acquire an entry in
:param limit: amount of entries allowed
:param expiry: expiry of the entry
:param amount: the number of entries to acquire
"""
return await self.bridge.acquire_entry(key, limit, expiry, amount)
async def get_moving_window(
self, key: str, limit: int, expiry: int
) -> tuple[float, int]:
"""
returns the starting point and the number of entries in the moving
window