code: public void add(Object msg, ChannelPromise promise) {
          assert ctx.executor().inEventLoop();
          if (msg == null) {
              throw new NullPointerException("msg");
          }
          if (promise == null) {
              throw new NullPointerException("promise");
          }
          // It is possible for writes to be triggered from removeAndFailAll(). To preserve ordering,
          // we should add them to the queue and let removeAndFailAll() fail them later.
          int messageSize = size(msg);
  
          PendingWrite write = PendingWrite.newInstance(msg, messageSize, promise);
          PendingWrite currentTail = tail;
          if (currentTail == null) {
              tail = head = write;
          } else {
              currentTail.next = write;
              tail = write;
          }
          size ++;
          bytes += messageSize;
          tracker.incrementPendingOutboundBytes(write.size);
      }
docs: Add the given {@code msg} and {@link ChannelPromise}.