mirror of
https://github.com/predis/predis.git
synced 2026-10-13 07:18:10 +00:00
Add new interfaces used to abstract the main client class and contexts.
Now developers can pass a client object or an executable context (see Predis\Transaction\MultiExecContext or Predis\Pipeline\PipelineContext) interchangeably as parameters to their methods using the new interface Predis\BasicCliantInterface. These new interfaces will also allow us to easily create new client classes aside from the standard Predis\Client one.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Defines the interface of a basic client object or abstraction that
|
||||
* can send commands to Redis.
|
||||
*
|
||||
* @author Daniele Alessandri <suppakilla@gmail.com>
|
||||
*/
|
||||
interface ExecutableContextInterface
|
||||
{
|
||||
/**
|
||||
* Starts the execution of the context.
|
||||
*
|
||||
* @param mixed $callable Optional callback for execution.
|
||||
* @return array
|
||||
*/
|
||||
public function execute($callable = null);
|
||||
}
|
||||
Reference in New Issue
Block a user