INNER CODE UNIT · Python

_is_async_redis_client

python-cachier/cachier · src/cachier/core.py:215

def _is_async_redis_client(client: Any) -> bool:
    if client is None:
        return False
    method_names = ("hgetall", "hset", "keys", "delete", "hget")
    return all(inspect.iscoroutinefunction(getattr(client, name, None)) for name in method_names)


def cachier(
    hash_func: Optional[HashFunc] = None,
    hash_params: Optional[HashFunc] = None,
    backend: Optional[Backend] = None,
    mongetter: Optional[Mongetter] = None,
    sql_engine: Optional[Union[str, Any, Callable[[], Any]]] = None,
    redis_client: Optional["RedisClient"] = None,
    s3_bucket: Optional[str] = None,
    s3_prefix: str = "cachier",
    s3_client: Optional["S3Client"] = None,
    s3_client_factory: Optional[Callable[[], Any]] = None,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…