redis.clients.jedis.Jedis.brpoplpush()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(234)

本文整理了Java中redis.clients.jedis.Jedis.brpoplpush()方法的一些代码示例,展示了Jedis.brpoplpush()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jedis.brpoplpush()方法的具体详情如下:
包路径:redis.clients.jedis.Jedis
类名称:Jedis
方法名:brpoplpush

Jedis.brpoplpush介绍

[英]Pop a value from a list, push it to another list and return it; or block until one is available
[中]从列表中弹出一个值,将其推送到另一个列表并返回;或阻塞,直到有一个可用

代码示例

代码示例来源:origin: sohutv/cachecloud

@Override
 public String execute(Jedis connection) {
  return connection.brpoplpush(source, destination, timeout);
 }
}.run(2, source, destination);

代码示例来源:origin: sohutv/cachecloud

@Override
 public byte[] execute(Jedis connection) {
  return connection.brpoplpush(source, destination, timeout);
 }
}.runBinary(2, source, destination);

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) {
  Assert.notNull(srcKey, "Source key must not be null!");
  Assert.notNull(dstKey, "Destination key must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().brpoplpush(srcKey, dstKey, timeout)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().brpoplpush(srcKey, dstKey, timeout)));
      return null;
    }
    return connection.getJedis().brpoplpush(srcKey, dstKey, timeout);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
 public byte[] execute(Jedis connection) {
  return connection.brpoplpush(source, destination, timeout);
 }
}.runBinary(2, source, destination);

代码示例来源:origin: tangyanbo/springmore

@Override
  public String action(Jedis jedis) {
    return jedis.brpoplpush(source, destination, timeout);
  }
});

代码示例来源:origin: yrain/smart-cache

@Override
  byte[] doInJedis(Jedis jedis) {
    return jedis.brpoplpush(srcKey, dstKey, timeout);
  }
});

代码示例来源:origin: apache/servicemix-bundles

@Override
 public String execute(Jedis connection) {
  return connection.brpoplpush(source, destination, timeout);
 }
}.run(2, source, destination);

代码示例来源:origin: io.leopard/leopard-redis

@Override
public String brpoplpush(String source, String destination, int timeout) {
  return jedis.brpoplpush(source, destination, timeout);
}

代码示例来源:origin: io.leopard/leopard-redis

@Override
public String brpoplpush(String source, String destination, int timeout) {
  return jedis.brpoplpush(source, destination, timeout);
}

代码示例来源:origin: penggle/jedis-ms-sentinel

public String brpoplpush(String source, String destination, int timeout) {
  return master.brpoplpush(source, destination, timeout);
}

代码示例来源:origin: penggle/jedis-ms-sentinel

public byte[] brpoplpush(byte[] source, byte[] destination, int timeout) {
  return master.brpoplpush(source, destination, timeout);
}

代码示例来源:origin: mindwind/craft-atom

private String brpoplpush0(Jedis j, String source, String  destination, int timeout) {
  return j.brpoplpush(source, destination, timeout);
}

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public String brpoplpush(String source, String destination, int timeout) {
 String command = "brpoplpush";
 return instrumented(command, () -> delegated.brpoplpush(source, destination, timeout));
}

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public byte[] brpoplpush(byte[] source, byte[] destination, int timeout) {
 String command = "brpoplpush";
 return instrumented(command, () -> delegated.brpoplpush(source, destination, timeout));
}

代码示例来源:origin: org.nutz/nutz-integration-jedis

/**
 * Pop a value from a list, push it to another list and return it; or block until one is available
 *
 * @param source
 * @param destination
 * @param timeout
 * @return the element
 */
public String brpoplpush(String source, String destination, int timeout) {
  Jedis jedis = getJedis();
  try {
    return jedis.brpoplpush(source, destination, timeout);
  } finally {Streams.safeClose(jedis);}
}

代码示例来源:origin: org.nutz/nutz-integration-jedis

/**
 * Pop a value from a list, push it to another list and return it; or block until one is available
 *
 * @param source
 * @param destination
 * @param timeout
 * @return the element
 */
public byte[] brpoplpush(byte[] source, byte[] destination, int timeout) {
  Jedis jedis = getJedis();
  try {
    return jedis.brpoplpush(source, destination, timeout);
  } finally {Streams.safeClose(jedis);}
}

代码示例来源:origin: io.enoa/nosql-redis

default <T> T brpoplpush(String source, String destination, int timeout) {
 return this.run((jedis, serializer) ->
  serializer.<T>reduction(jedis.brpoplpush(SafeEncoder.encode(source), SafeEncoder.encode(destination), timeout)));
}

代码示例来源:origin: org.nanoframework/nano-orm-jedis

@Override
public String brpoplpush(final String source, final String destination, final int timeout) {
  Assert.hasText(source);
  Assert.hasText(destination);
  ShardedJedis jedis = null;
  try {
    jedis = POOL.getJedis(config.getRedisType());
    if (jedis.getAllShards().size() == 1) {
      return jedis.getAllShards().iterator().next().brpoplpush(source, destination, timeout);
    } else {
      throw new RedisClientException("不支持Sharding的模式进行brpoplpush操作,如果只配置一个节点则支持此操作.");
    }
  } catch (final Throwable e) {
    throw new RedisClientException(e.getMessage(), e);
  } finally {
    POOL.close(jedis);
  }
}

代码示例来源:origin: org.springframework.data/spring-data-redis

@Override
public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) {
  Assert.notNull(srcKey, "Source key must not be null!");
  Assert.notNull(dstKey, "Destination key must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().brpoplpush(srcKey, dstKey, timeout)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().brpoplpush(srcKey, dstKey, timeout)));
      return null;
    }
    return connection.getJedis().brpoplpush(srcKey, dstKey, timeout);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) {
  Assert.notNull(srcKey, "Source key must not be null!");
  Assert.notNull(dstKey, "Destination key must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().brpoplpush(srcKey, dstKey, timeout)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().brpoplpush(srcKey, dstKey, timeout)));
      return null;
    }
    return connection.getJedis().brpoplpush(srcKey, dstKey, timeout);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

相关文章

Jedis类方法