Skip to main content

prefect_redis.client

Functions

cached

cached(fn: Callable[..., Any]) -> Callable[..., Any]

close_all_cached_connections

close_all_cached_connections() -> None
Close all cached Redis connections.

clear_cached_clients

clear_cached_clients() -> None
Clear all cached Redis clients to force fresh connections. This should be called when a connection error is detected to ensure subsequent calls to get_async_redis_client() return fresh clients rather than stale ones with broken connections.

get_async_redis_client

get_async_redis_client(host: Union[str, None] = None, port: Union[int, None] = None, db: Union[int, None] = None, password: Union[str, None] = None, username: Union[str, None] = None, health_check_interval: Union[int, None] = None, decode_responses: bool = True, ssl: Union[bool, None] = None) -> Redis
Retrieves an async Redis client. Args:
  • host: The host location.
  • port: The port to connect to the host with.
  • db: The Redis database to interact with.
  • password: The password for the redis host
  • username: Username for the redis instance
  • decode_responses: Whether to decode binary responses from Redis to unicode strings.
Returns:
  • a Redis client

async_redis_from_settings

async_redis_from_settings(settings: RedisMessagingSettings, **options: Any) -> Redis

Classes

RedisMessagingSettings