Disque\Connection\Manager::execute PHP Method

execute() public method

public execute ( Disque\Command\CommandInterface $command )
$command Disque\Command\CommandInterface
    public function execute(CommandInterface $command)
    {
        $this->shouldBeConnected();
        $command = $this->preprocessExecution($command);
        $response = $this->getCurrentNode()->execute($command);
        $response = $this->postprocessExecution($command, $response);
        return $response;
    }

Usage Example

Beispiel #1
0
 /**
  * @throws InvalidCommandException
  */
 public function __call($command, array $arguments)
 {
     $command = strtoupper($command);
     if (!isset($this->commandHandlers[$command])) {
         throw new InvalidCommandException($command);
     }
     $command = $this->commandHandlers[$command];
     $command->setArguments($arguments);
     $result = $this->connectionManager->execute($command);
     return $command->parse($result);
 }