code: public void eventSunk(final ChannelPipeline pipeline, final ChannelEvent e)
              throws Exception {
  
          final NioChildDatagramChannel childChannel = (NioChildDatagramChannel) e.getChannel();
          final ChannelFuture childFuture = e.getFuture();
          if (e instanceof ChannelStateEvent) {
              final ChannelStateEvent stateEvent = (ChannelStateEvent) e;
              final ChannelState state = stateEvent.getState();
              final Object value = stateEvent.getValue();
              switch (state) {
                  case OPEN:
                      if (Boolean.FALSE.equals(value)) {
                          childChannel.worker.close(childChannel, childFuture);
                      }
                      break;
              }
          } else if (e instanceof MessageEvent) {
              // Making sure that child channel WriteFuture is fired on child channel's worker thread
              final MessageEvent childMessageEvent = (MessageEvent) e;
              ParentMessageEvent parentMessageEvent = new ParentMessageEvent(childMessageEvent);
              ChannelFuture parentFuture = parentMessageEvent.getFuture();
              parentFuture.addListener(f -> {
                  childChannel.getWorker().executeInIoThread(() -> {
                      if (f.isSuccess()) {
                          childFuture.setSuccess();
                      } else {
                          childFuture.setFailure(f.getCause());
                      }
                  });
              });
  
              // Write to parent channel
              NioDatagramChannel parentChannel = (NioDatagramChannel) childChannel.getParent();
              boolean offered = parentChannel.writeBufferQueue.offer(parentMessageEvent);
              assert offered;
              parentChannel.worker.writeFromUserCode(parentChannel);
          }
      }
docs: Handle downstream event.
  
  @param pipeline the {@link ChannelPipeline} that passes down the
  downstream event.
  @param e The downstream event.