Exemple #1
0
 public void blpop(final String[] args) {
   final byte[][] bargs = new byte[args.length][];
   for (int i = 0; i < bargs.length; i++) {
     bargs[i] = SafeEncoder.encode(args[i]);
   }
   blpop(bargs);
 }
Exemple #2
0
 public void blpop(final int timeout, final String... keys) {
   final int size = keys.length + 1;
   List<String> args = new ArrayList<String>(size);
   for (String arg : keys) {
     args.add(arg);
   }
   args.add(String.valueOf(timeout));
   blpop(args.toArray(new String[size]));
 }
Exemple #3
0
  public List<String> blpop(int timeout, String... keys) {
    checkIsInMulti();
    List<String> args = new ArrayList<String>();
    for (String arg : keys) {
      args.add(arg);
    }
    args.add(String.valueOf(timeout));

    client.blpop(args.toArray(new String[args.size()]));
    client.setTimeoutInfinite();
    List<String> multiBulkReply = client.getMultiBulkReply();
    client.rollbackTimeout();
    return multiBulkReply;
  }