Disque\Connection\Socket::execute PHP Method

execute() public method

public execute ( Disque\Command\CommandInterface $command )
$command Disque\Command\CommandInterface
    public function execute(CommandInterface $command)
    {
        $commandName = $command->getCommand();
        $arguments = $command->getArguments();
        $totalArguments = count($arguments);
        $parts = ['*' . ($totalArguments + 1), '$' . strlen($commandName), $commandName];
        for ($i = 0; $i < $totalArguments; $i++) {
            $argument = $arguments[$i];
            $parts[] = '$' . strlen($argument);
            $parts[] = $argument;
        }
        $this->send(implode("\r\n", $parts) . "\r\n");
        return $this->receive($command->isBlocking());
    }