/** * {@inheritdoc} */ public function writeCommand(CommandInterface $command) { $cmdargs = $command->getArguments(); array_unshift($cmdargs, $command->getId()); $this->writeBytes(phpiredis_format_command($cmdargs)); }
/** * {@inheritdoc} */ public function writeRequest(CommandInterface $command) { $arguments = $command->getArguments(); array_unshift($arguments, $command->getId()); $this->write(phpiredis_format_command($arguments)); }
/** * {@inheritdoc} */ public function executeCommand(CommandInterface $command, callable $callback) { if ($this->buffer->isEmpty() && ($stream = $this->getResource())) { $this->loop->addWriteStream($stream, $this->writableCallback); } $cmdargs = $command->getArguments(); array_unshift($cmdargs, $command->getId()); $this->buffer->append(phpiredis_format_command($cmdargs)); $this->commands->enqueue([$command, $callback]); }