本文整理汇总了Java中com.lambdaworks.redis.RedisConnection.get方法的典型用法代码示例。如果您正苦于以下问题:Java RedisConnection.get方法的具体用法?Java RedisConnection.get怎么用?Java RedisConnection.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.lambdaworks.redis.RedisConnection
的用法示例。
在下文中一共展示了RedisConnection.get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testLettuce
import com.lambdaworks.redis.RedisConnection; //导入方法依赖的package包/类
@POST
@Path("testLettuce")
public void testLettuce(String jsonString) {
RedisClient redisClient = RedisClient.create("redis://localhost:6379/0");
RedisConnection<String, String> conn1 = redisClient.connect();
conn1.set("foo", "bar");
String value = conn1.get("foo");
System.out.println(value);
conn1.close();
redisClient.shutdown();
RedisClient client = RedisClient.create("redis://localhost:6379/0");
RedisAsyncConnection<String, String> conn = client.connectAsync();
conn.set("foo", "bar");
conn.get("foo");
conn.lpush("lll", "a");
conn.lpush("lll", "b");
conn.lpush("lll", "c");
conn.lpop("lll");
conn.lpop("lll");
conn.lpop("lll");
conn.hset("mmm", "abc", "123");
conn.hset("mmm", "def", "456");
conn.hgetall("mmm");
conn.del("foo", "lll", "mmm");
conn.close();
client.shutdown();
}
示例2: lettucetest
import com.lambdaworks.redis.RedisConnection; //导入方法依赖的package包/类
@GET
@Path("lettucetest")
@Produces(MediaType.TEXT_HTML + ";charset=utf-8")
public String lettucetest() {
System.out.println("TEST Lettuce sync ======================================================");
RedisClient redisClient = RedisClient.create("redis://localhost:6379/0");
RedisConnection<String, String> conn = redisClient.connect();
conn.set("foo", "bar");
conn.get("foo");
conn.lpush("lll", "a");
conn.lpush("lll", "b");
conn.lpush("lll", "c");
conn.lpop("lll");
conn.lpop("lll");
conn.lpop("lll");
conn.hset("mmm", "abc", "123");
conn.hset("mmm", "def", "456");
conn.hgetall("mmm");
conn.del("foo", "lll", "mmm");
conn.close();
redisClient.shutdown();
return "lettucetest";
}
示例3: testSync
import com.lambdaworks.redis.RedisConnection; //导入方法依赖的package包/类
private static void testSync() {
System.out.println("TEST Lettuce sync ======================================================");
RedisClient redisClient = RedisClient.create("redis://localhost:6379/0");
RedisConnection<String, String> conn = redisClient.connect();
System.out.println("Connected to Redis");
conn.set("foo", "bar");
String value = conn.get("foo");
System.out.println(value);
conn.close();
redisClient.shutdown();
}