use of com.hazelcast.ringbuffer.ReadResultSet in project hazelcast by hazelcast.
the class RingbufferAbstractTest method readyManyAsync_whenSomeWaitingForSingleItemNeeded.
@Test
public void readyManyAsync_whenSomeWaitingForSingleItemNeeded() throws ExecutionException, InterruptedException {
final ICompletableFuture<ReadResultSet<String>> f = ringbuffer.readManyAsync(0, 1, 10, null);
assertTrueAllTheTime(new AssertTask() {
@Override
public void run() throws Exception {
assertFalse(f.isDone());
}
}, 5);
ringbuffer.add("1");
assertCompletesEventually(f);
ReadResultSet<String> resultSet = f.get();
assertThat(f.get(), contains("1"));
assertEquals(1, resultSet.readCount());
}
Aggregations