use of com.lcache.extend.handle.pipeline.PipelineZremRangeByScore in project lcache by long172066912.
the class TestRedisCache2 method testPipeline.
@Test
public void testPipeline() {
BaseCacheExecutor baseCacheExecutor = CacheClientFactory.getCacheExecutor("friend", new LettuceConnectSourceConfig());
// while (true){
List<PipelineCmd> commands = new ArrayList<>();
for (int i = 0; i < 100; i++) {
commands.add(new PipelineGet("test"));
}
commands.add(new PipelineZremRangeByScore("test111", 0, System.currentTimeMillis()));
// 同步方式
List<Object> resList = baseCacheExecutor.pSync(commands);
System.out.println(JSON.toJSONString(resList));
// 异步方式
CompletableFuture<List<Object>> listCompletableFuture = baseCacheExecutor.pAsync(commands);
// }
}
Aggregations