from typing import Any, Optional, Protocol

MISSING = object()

class CacheBackend(Protocol):
    """Protocol/Interface para backends de persistência."""
    
    def get(self, key: str) -> Optional[Any]: ...
    def set(self, key: str, value: Any, ttl: Optional[float] = None) -> None: ...
    def delete(self, key: str) -> None: ...
    def clear(self) -> None: ...
    def cleanup_expired(self) -> int: ...