code: public void addFlush() {
          // There is no need to process all entries if there was already a flush before and no new messages
          // where added in the meantime.
          //
          // See https://github.com/netty/netty/issues/2577
          Entry entry = unflushedEntry;
          if (entry != null) {
              if (flushedEntry == null) {
                  // there is no flushedEntry yet, so start with the entry
                  flushedEntry = entry;
              }
              do {
                  flushed ++;
                  if (!entry.promise.setUncancellable()) {
                      // Was cancelled so make sure we free up memory and notify about the freed bytes
                      int pending = entry.cancel();
                      decrementPendingOutboundBytes(pending, false, true);
                  }
                  entry = entry.next;
              } while (entry != null);
  
              // All flushed so reset unflushedEntry
              unflushedEntry = null;
          }
      }
docs: Add a flush to this {@link ChannelOutboundBuffer}. This means all previous added messages are marked as flushed
  and so you will be able to handle them.