code: @Override
    public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception {
      final ByteBuf message = (ByteBuf) msg;
      final byte magic = message.getByte(0);
  
      // The majority of messages are likely to be stream requests, not responses.
      if (magic != MessageUtil.MAGIC_RES) {
        handleRequest(ctx, message);
        return;
      }
  
      // "The current protocol dictates that the server won't start
      // processing the next command until the current command is completely
      // processed (due to the lack of barriers or any other primitives to
      // enforce execution order). The protocol defines some "quiet commands"
      // which won't send responses in certain cases (success for mutations,
      // not found for gets etc). The client would know that such commands
      // was executed when it encounters the response for the next command
      // requested issued by the client."
      // -- https://github.com/couchbase/memcached/blob/master/docs/BinaryProtocol.md#introduction-1
  
      // The DCP client does not send any "quiet commands", so we assume
      // a 1:1 relationship between requests and responses, and FIFO order.
      final OutstandingRequest request = outstandingRequests.poll();
      if (request == null || MessageUtil.getOpaque(message) != request.opaque) {
        // Should never happen so long as all requests are made via sendRequest()
        // and successfully written to the channel.
        LOGGER.error("Unexpected response with opaque {} (expected {}); closing connection",
            MessageUtil.getOpaque(message), request == null ? "none" : request.opaque);
        ctx.close();
        return;
      }
  
      request.promise.setSuccess(new DcpResponse(message));
    }
docs: Reads server responses and uses them to fulfill promises returned by
  {@link #sendRequest}.
  <p>
  Dispatches other incoming messages to either the data or the control feeds.