docs: protected boolean dispatch(final Collection<? extends ItemHolder> all, int size)
      {
          ItemHolder[] array = all.toArray(new ItemHolder[all.size()]);
          // protected against handlers unregistering during this loop
          for (ItemHolder holder : array) {
              EventsHandler handler = holder.handler();
              if (handler == null) {
                  handler = globalHandler;
              }
              if (handler == null) {
                  // no handler, short-circuit
                  continue;
              }
              final PollItem item = holder.item();
              final int events = item.readyOps();
  
              if (events <= 0) {
                  // no events, short-circuit
                  continue;
              }
              final Socket socket = holder.socket();
              final SelectableChannel channel = holder.item().getRawSocket();
  
              if (socket != null) {
                  assert (channel == null);
                  // dispatch on socket
                  if (!handler.events(socket, events)) {
                      return false;
                  }
              }
              if (channel != null) {
                  // dispatch on channel
                  assert (socket == null);
                  if (!handler.events(channel, events)) {
                      return false;
                  }
              }
          }
          return true;
      }