code: @Handler
      public void onNioRegistration(NioRegistration event)
              throws IOException {
          SelectableChannel channel = event.ioChannel();
          channel.configureBlocking(false);
          SelectionKey key;
          synchronized (selectorGate) {
              selector.wakeup(); // make sure selector isn't blocking
              key = channel.register(
                  selector, event.ops(), event.handler());
          }
          event.setResult(new Registration(key));
      }
docs: Handle the NIO registration.
  
  @param event the event
  @throws IOException Signals that an I/O exception has occurred.