66from glide import (
77 AllNodes ,
88 BaseClientConfiguration ,
9+ GlideClient ,
10+ GlideClusterClient ,
911 Logger ,
1012 LogLevel ,
1113 NodeAddress ,
12- RedisClient ,
13- RedisClusterClient ,
1414)
1515
1616
@@ -28,7 +28,7 @@ def set_file_logger(level: LogLevel = LogLevel.WARN, file: Optional[str] = None)
2828 Logger .set_logger_config (level , file )
2929
3030
31- async def send_set_and_get (client : Union [RedisClient , RedisClusterClient ]):
31+ async def send_set_and_get (client : Union [GlideClient , GlideClusterClient ]):
3232 set_response = await client .set ("foo" , "bar" )
3333 print (f"Set response is = { set_response } " )
3434 get_response = await client .get ("foo" )
@@ -39,14 +39,14 @@ async def test_standalone_client(host: str = "localhost", port: int = 6379):
3939 # When in Redis is in standalone mode, add address of the primary node,
4040 # and any replicas you'd like to be able to read from.
4141 addresses = [NodeAddress (host , port )]
42- # Check `RedisClientConfiguration /ClusterClientConfiguration` for additional options.
42+ # Check `GlideClientConfiguration /ClusterClientConfiguration` for additional options.
4343 config = BaseClientConfiguration (
4444 addresses = addresses ,
4545 client_name = "test_standalone_client" ,
4646 # if the server use TLS, you'll need to enable it. Otherwise the connection attempt will time out silently.
4747 # use_tls=True
4848 )
49- client = await RedisClient .create (config )
49+ client = await GlideClient .create (config )
5050
5151 # Send SET and GET
5252 await send_set_and_get (client )
@@ -58,14 +58,14 @@ async def test_standalone_client(host: str = "localhost", port: int = 6379):
5858async def test_cluster_client (host : str = "localhost" , port : int = 6379 ):
5959 # When in Redis is cluster mode, add address of any nodes, and the client will find all nodes in the cluster.
6060 addresses = [NodeAddress (host , port )]
61- # Check `RedisClientConfiguration /ClusterClientConfiguration` for additional options.
61+ # Check `GlideClientConfiguration /ClusterClientConfiguration` for additional options.
6262 config = BaseClientConfiguration (
6363 addresses = addresses ,
6464 client_name = "test_cluster_client" ,
6565 # if the cluster nodes use TLS, you'll need to enable it. Otherwise the connection attempt will time out silently.
6666 # use_tls=True
6767 )
68- client = await RedisClusterClient .create (config )
68+ client = await GlideClusterClient .create (config )
6969
7070 # Send SET and GET
7171 await send_set_and_get (client )
0 commit comments