Examples of evalsha()


Examples of redis.clients.jedis.Jedis.evalsha()

             args.add(String.valueOf(System.currentTimeMillis()));//max
             args.add(String.valueOf(maxNumberOfMessages));//number of message
             args.add(String.valueOf(System.currentTimeMillis()+visibilityTO*1000)); //new score
             long ts1 = System.currentTimeMillis();
             try {
               memIds = new HashSet<String>((List <String>)j.evalsha(luaChangeScoreToHigherSHA, keys, args));
             } catch (JedisDataException e) {
               if (e.getMessage().startsWith("NOSCRIPT")) {
                 luaChangeScoreToHigherSHA = new String(j.scriptLoad(luaChangeScoreToHigher.getBytes()));
                 memIds = new HashSet<String>((List <String>)j.evalsha(luaChangeScoreToHigherSHA, keys, args));
               } else {
View Full Code Here

Examples of redis.clients.jedis.Jedis.evalsha()

             try {
               memIds = new HashSet<String>((List <String>)j.evalsha(luaChangeScoreToHigherSHA, keys, args));
             } catch (JedisDataException e) {
               if (e.getMessage().startsWith("NOSCRIPT")) {
                 luaChangeScoreToHigherSHA = new String(j.scriptLoad(luaChangeScoreToHigher.getBytes()));
                 memIds = new HashSet<String>((List <String>)j.evalsha(luaChangeScoreToHigherSHA, keys, args));
               } else {
                 throw e;
               }
             }
             long ts2 = System.currentTimeMillis();
View Full Code Here

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

  String sha1 = jedis.scriptLoad(script);

  assertTrue(jedis.scriptExists(sha1));

  Pipeline p = jedis.pipelined();
  Response<String> result = p.evalsha(sha1);
  p.sync();

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

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

  assertTrue(jedis.scriptExists(sha1));

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

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

  Pipeline p = jedis.pipelined();
  p.set(key, "0");
  Response<String> result0 = p.evalsha(sha1, Arrays.asList(key),
    Arrays.asList(arg));
  p.incr(key);
  Response<String> result1 = p.evalsha(sha1, 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.