use of org.redisson.client.protocol.CommandData in project redisson by redisson.
the class RedisClientTest method testPipelineBigResponse.
@Test
public void testPipelineBigResponse() throws InterruptedException, ExecutionException {
RedisClient c = new RedisClient(RedisRunner.getDefaultRedisServerBindAddressAndPort());
RedisConnection conn = c.connect();
List<CommandData<?, ?>> commands = new ArrayList<CommandData<?, ?>>();
for (int i = 0; i < 1000; i++) {
CommandData<String, String> cmd1 = conn.create(null, RedisCommands.PING);
commands.add(cmd1);
}
RPromise<Void> p = new RedissonPromise<Void>();
conn.send(new CommandsData(p, commands));
for (CommandData<?, ?> commandData : commands) {
commandData.getPromise().get();
}
conn.sync(RedisCommands.FLUSHDB);
}
Aggregations