code: @Override
      public void execute(Runnable task) {
          if (shutdown) {
              rejectTask(task);
          }
  
          // Check that it's a IoEvent task
          checkTaskType(task);
  
          IoEvent event = (IoEvent) task;
          
          // Get the associated session
          IoSession session = event.getSession();
          
          // Get the session's queue of events
          SessionTasksQueue sessionTasksQueue = getSessionTasksQueue(session);
          Queue<Runnable> tasksQueue = sessionTasksQueue.tasksQueue;
          
          boolean offerSession;
  
          // propose the new event to the event queue handler. If we
          // use a throttle queue handler, the message may be rejected
          // if the maximum size has been reached.
          boolean offerEvent = eventQueueHandler.accept(this, event);
          
          if (offerEvent) {
              // Ok, the message has been accepted
              synchronized (tasksQueue) {
                  // Inject the event into the executor taskQueue
                  tasksQueue.offer(event);
                  
                  if (sessionTasksQueue.processingCompleted) {
                      sessionTasksQueue.processingCompleted = false;
                      offerSession = true;
                  } else {
                      offerSession = false;
                  }
  
                  if (LOGGER.isDebugEnabled()) {
                      print(tasksQueue, event);
                  }
              }
          } else {
              offerSession = false;
          }
  
          if (offerSession) {
              // As the tasksQueue was empty, the task has been executed
              // immediately, so we can move the session to the queue
              // of sessions waiting for completion.
              waitingSessions.offer(session);
          }
  
          addWorkerIfNecessary();
  
          if (offerEvent) {
              eventQueueHandler.offered(this, event);
          }
      }
docs: {@inheritDoc}