INNER CODE UNIT · Python

acquire_sliding_window_entry

alisaifee/limits · limits/aio/storage/redis/__init__.py:204

    async def acquire_sliding_window_entry(
        self,
        key: str,
        limit: int,
        expiry: int,
        amount: int = 1,
    ) -> bool:
        current_key = self._current_window_key(key)
        previous_key = self._previous_window_key(key)
        return await self.bridge.acquire_sliding_window_entry(
            previous_key, current_key, limit, expiry, amount
        )

    async def get_sliding_window(
        self, key: str, expiry: int
    ) -> tuple[int, float, int, float]:
        previous_key = self._previous_window_key(key)
        current_key = self._current_window_key(key)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…