private void scheduleNextChunk() {
            synchronized (this) {
                if (scheduled) {
                    // Dispatch task is already scheduled.
                    return;
                }

                // Schedule the next response chunk if there is one.
                final Chunk nextChunk = chunks.peek();
                if (nextChunk != null) {
                    scheduled = true;
                    // TODO(ejona): cancel future if RPC is cancelled
                    final Future<?> unused = executor.schedule(new LogExceptionRunnable(dispatchTask),
                                                               nextChunk.delayMicroseconds,
                                                               TimeUnit.MICROSECONDS);
                    return;
                }
            }
        }
Schedules the next response chunk to be dispatched. If all input has been received and there
are no more chunks in the queue, the stream is closed.
grpc/src/test/java/com/linecorp/armeria/internal/common/grpc/TestServiceImpl.java