code: public ChannelPromise remove() {
          assert ctx.executor().inEventLoop();
          PendingWrite write = head;
          if (write == null) {
              return null;
          }
          ChannelPromise promise = write.promise;
          ReferenceCountUtil.safeRelease(write.msg);
          recycle(write, true);
          return promise;
      }
docs: Removes a pending write operation and release it's message via {@link ReferenceCountUtil#safeRelease(Object)}.
  
  @return  {@link ChannelPromise} of the pending write or {@code null} if the queue is empty.