code: private ChannelFuture respond(Encodable result) {
      SocketAddress remoteAddress = channel.remoteAddress();
      return channel.writeAndFlush(result).addListener(future -> {
        if (future.isSuccess()) {
          logger.trace("Sent result {} to client {}", result, remoteAddress);
        } else {
          logger.error(String.format("Error sending result %s to %s; closing connection",
            result, remoteAddress), future.cause());
          channel.close();
        }
      });
    }
docs: Responds to a single message with some Encodable object. If a failure occurs while sending,
  it will be logged and the channel closed.