if (inboundMessageBuffer().drainTo(forwardNextBuf) > 0) {
inboundBufferUpdated = true;
}
}
if (flush) {
EventExecutor executor = executor();
Thread currentThread = Thread.currentThread();
if (executor.inEventLoop(currentThread)) {
invokePrevFlush(newPromise(), currentThread, findContextOutboundInclusive(forwardPrev));
} else {
executor.execute(new Runnable() {
@Override
public void run() {
invokePrevFlush(newPromise(), Thread.currentThread(),
findContextOutboundInclusive(forwardPrev));
}
});
}
}
if (inboundBufferUpdated) {
EventExecutor executor = executor();
if (executor.inEventLoop()) {
fireInboundBufferUpdated0(findContextInboundInclusive(forwardNext));
} else {
executor.execute(new Runnable() {
@Override
public void run() {
fireInboundBufferUpdated0(findContextInboundInclusive(forwardNext));
}
});