code: private void unschedule() throws IOException {
          // since everything is written, we are not interested anymore in write-events, so lets unsubscribe
          unregisterOp(OP_WRITE);
          // So the outputBuffer is empty, so we are going to unschedule the pipeline.
          scheduled.set(false);
  
          if (writeQueue.isEmpty() && priorityWriteQueue.isEmpty()) {
              // there are no remaining frames, so we are done.
              return;
          }
  
          // So there are frames, but we just unscheduled ourselves. If we don't try to reschedule, then these
          // Frames are at risk not to be send.
          if (!scheduled.compareAndSet(false, true)) {
              //someone else managed to schedule this OutboundHandler, so we are done.
              return;
          }
  
          // We managed to reschedule. So lets add ourselves to the owner so we are processed again.
          // We don't need to call wakeup because the current thread is the IO-thread and the selectionQueue will be processed
          // till it is empty. So it will also pick up tasks that are added while it is processing the selectionQueue.
  
          // owner can't be null because this method is made by the owning io thread.
          owner().addTask(this);
      }
docs: Tries to unschedule this pipeline.
  <p/>
  It will only be unscheduled if:
  - there are no pending frames.
  <p/>
  If the outputBuffer is dirty then it will register itself for an OP_WRITE since we are interested in knowing
  if there is more space in the socket output buffer.
  If the outputBuffer is not dirty, then it will unregister itself from an OP_WRITE since it isn't interested
  in space in the socket outputBuffer.
  <p/>
  This call is only made by the owning IO thread.