Added Predis\ClientContextInterface.

This interface replaces Predis\ExecutableContextInterface and it is
used by client-side contexts such as pipelines or transactions.
This commit is contained in:
Daniele Alessandri
2014-07-27 10:46:11 +02:00
parent 7d78600506
commit 38710cd69b
5 changed files with 56 additions and 33 deletions
+48
View File
@@ -0,0 +1,48 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Predis;
use Predis\Command\CommandInterface;
/**
* Interface defining a client-side context such as a pipeline or transaction.
*
* @author Daniele Alessandri <suppakilla@gmail.com>
*/
interface ClientContextInterface
{
/**
* Sends the specified command instance to Redis.
*
* @param CommandInterface $command Command instance.
* @return mixed
*/
public function executeCommand(CommandInterface $command);
/**
* Sends the specified command with its arguments to Redis.
*
* @param string $commandID Command ID.
* @param array $arguments Arguments for the command.
* @return mixed
*/
public function __call($method, $arguments);
/**
* Starts the execution of the context.
*
* @param mixed $callable Optional callback for execution.
* @return array
*/
public function execute($callable = null);
}