| """Cache service — inspection + invalidation.""" | |
| from __future__ import annotations | |
| from storage.cache import Cache | |
| class CacheService: | |
| """Read-mostly cache facade.""" | |
| def __init__(self, cache: Cache) -> None: | |
| self._cache = cache | |
| def stats(self) -> dict: | |
| return self._cache.stats() | |
| def invalidate(self, key: str) -> bool: | |
| return self._cache.invalidate(key) | |
| def clear(self) -> int: | |
| n = self._cache.clear() | |
| return n | |