@Test(dataProvider = "offsets") public void testExpandCapacity(int splitOffset) throws Throwable { CompletableFuture<Object> future = new CompletableFuture<>(); QueueAsyncInvocationStage stage = new QueueAsyncInvocationStage(null, null, future, makeCallback(0)); assertCallback(0, stage.queuePoll()); addAndPoll(stage, splitOffset); int count = 2 * QueueAsyncInvocationStage.QUEUE_INITIAL_CAPACITY; addAndPoll(stage, count); }
InvocationCallback queuePoll() { InvocationCallback element; synchronized (this) { if (tail != head) { element = elements[head & mask]; head++; } else { element = null; frozen = true; } } return element; }
QueueAsyncInvocationStage extends SimpleAsyncInvocationStage implements BiConsumer<Object, Throwable>,
      InvocationCallback { InvocationCallback queuePoll() { InvocationCallback element; synchronized (this) { if (tail != head) { element = elements[head & mask]; head++; } else { element = null; frozen = true; } } return element; } }
QueueAsyncInvocationStage extends SimpleAsyncInvocationStage implements BiConsumer<Object, Throwable>,
      InvocationCallback { InvocationCallback queuePoll() { InvocationCallback element; synchronized (this) { if (tail != head) { element = elements[head & mask]; head++; } else { element = null; frozen = true; } } return element; } QueueAsyncInvocationStage(InvocationContext ctx, VisitableCommand command,
                                    CompletableFuture<?> valueFuture, InvocationCallback function); }
QueueAsyncInvocationStage extends SimpleAsyncInvocationStage implements BiConsumer<Object, Throwable>,
      InvocationCallback { InvocationCallback queuePoll() { InvocationCallback element; synchronized (this) { if (tail != head) { element = elements[head & mask]; head++; } else { element = null; frozen = true; } } return element; } QueueAsyncInvocationStage(InvocationContext ctx, VisitableCommand command,
                                    CompletableFuture<?> valueFuture, InvocationCallback function); @Override Object addCallback(InvocationContext ctx, VisitableCommand command, InvocationCallback function); @Override void accept(Object rv, Throwable throwable); @Override Object apply(InvocationContext rCtx, VisitableCommand rCommand, Object rv, Throwable throwable); @Override String toString(); }
QueueAsyncInvocationStage extends SimpleAsyncInvocationStage implements BiConsumer<Object, Throwable>,
      InvocationCallback { InvocationCallback queuePoll() { InvocationCallback element; synchronized (this) { if (tail != head) { element = elements[head & mask]; head++; } else { element = null; frozen = true; } } return element; } QueueAsyncInvocationStage(InvocationContext ctx, VisitableCommand command,
                                    CompletableFuture<?> valueFuture, InvocationCallback function); @Override Object addCallback(InvocationContext ctx, VisitableCommand command, InvocationCallback function); @Override void accept(Object rv, Throwable throwable); @Override Object apply(InvocationContext rCtx, VisitableCommand rCommand, Object rv, Throwable throwable); @Override String toString();  }