code: @Override
    public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
        throws Exception {
      if (msg instanceof SendGrpcFrameCommand) {
        sendGrpcFrame(ctx, (SendGrpcFrameCommand) msg, promise);
      } else if (msg instanceof SendResponseHeadersCommand) {
        sendResponseHeaders(ctx, (SendResponseHeadersCommand) msg, promise);
      } else if (msg instanceof CancelServerStreamCommand) {
        cancelStream(ctx, (CancelServerStreamCommand) msg, promise);
      } else if (msg instanceof ForcefulCloseCommand) {
        forcefulClose(ctx, (ForcefulCloseCommand) msg, promise);
      } else {
        AssertionError e =
            new AssertionError("Write called for unexpected type: " + msg.getClass().getName());
        ReferenceCountUtil.release(msg);
        promise.setFailure(e);
        throw e;
      }
    }
docs: Handler for commands sent from the stream.