Lettuce是一个可伸缩线程安全的Redis客户端。多个线程可以共享同一个RedisConnection。它利用优秀nettyNIO框架来高效地管理多个连接。
示例代码:
RedisClient client = new RedisClient("localhost")RedisConnection<String, String> connection = client.connect()String value = connection.get("key")异步APIStatefulRedisConnection<String,String>connection=client.connect();RedisStringAsyncCommands<String,String>async=connection.async();RedisFuture<String>set=async.set("key","value")RedisFuture<String>get=async.get("key")async.awaitAll(set,get)==trueset.get()=="OK"get.get()=="value"
评论