INNER CODE UNIT · Python

get_sliding_window

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

    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)
        return await self.bridge.get_sliding_window(previous_key, current_key, expiry)

    async def clear_sliding_window(self, key: str, expiry: int) -> None:
        previous_key = self._previous_window_key(key)
        current_key = self._current_window_key(key)
        await asyncio.gather(self.clear(previous_key), self.clear(current_key))

    async def get_expiry(self, key: str) -> float:
        """
        :param key: the key to get the expiry for
        """

        return await self.bridge.get_expiry(key)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…