/** * Send request and retrieve response to the connected disque node. * * @param array $args * @return array|int|null|string * * @throws CommandException * @throws StreamException */ protected function send(array $args = []) { $this->log->debug('send()ing command', $args); $response = RespUtils::deserialize($this->stream->write(RespUtils::serialize($args))); $this->log->debug('response', [$response]); return $response; }
/** * @param string $msg * @param int|null $len * * @return StreamInterface the Stream instance. */ public function write($msg, $len = null) { $this->connected->write($msg, $len); return $this; }