/** * 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; }
/** * Return the job with the given jobId. * * @param string $jobId * * @return Job|null * @throws CommandException */ public function show($jobId) { $result = $this->send(['SHOW', (string) $jobId]); if (!$result) { return null; } return Job::create(RespUtils::toAssoc($result)); }