Package redis.clients.jedis

Examples of redis.clients.jedis.Pipeline.eval()


    @Test
    public void testEval() {
  String script = "return 'success!'";

  Pipeline p = jedis.pipelined();
  Response<String> result = p.eval(script);
  p.sync();

  assertEquals("success!", result.get());
    }
View Full Code Here


  String arg = "3";
  String script = "redis.call('INCRBY', KEYS[1], ARGV[1]) redis.call('INCRBY', KEYS[1], ARGV[1])";

  Pipeline p = jedis.pipelined();
  p.set(key, "0");
  Response<String> result0 = p.eval(script, Arrays.asList(key),
    Arrays.asList(arg));
  p.incr(key);
  Response<String> result1 = p.eval(script, Arrays.asList(key),
    Arrays.asList(arg));
  Response<String> result2 = p.get(key);
View Full Code Here

  Pipeline p = jedis.pipelined();
  p.set(key, "0");
  Response<String> result0 = p.eval(script, Arrays.asList(key),
    Arrays.asList(arg));
  p.incr(key);
  Response<String> result1 = p.eval(script, Arrays.asList(key),
    Arrays.asList(arg));
  Response<String> result2 = p.get(key);
  p.sync();

  assertNull(result0.get());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.