PHP Class Predis\Pipeline\Pipeline

Author: Daniele Alessandri ([email protected])
Inheritance: implements Predis\ClientContextInterface
Mostrar archivo Open project: nrk/predis Class Usage Examples

Public Methods

Method Description
__call ( string $method, array $arguments ) Queues a command into the pipeline buffer.
__construct ( Predis\ClientInterface $client )
execute ( mixed $callable = null ) : array Handles the actual execution of the whole pipeline.
executeCommand ( Predis\Command\CommandInterface $command ) Queues a command instance into the pipeline buffer.
flushPipeline ( boolean $send = true ) Flushes the buffer holding all of the commands queued so far.
getClient ( ) : Predis\ClientInterface Returns the underlying client instance used by the pipeline object.

Protected Methods

Method Description
exception ( Predis\Connection\ConnectionInterface $connection, Predis\Response\ErrorInterface $response ) Throws an exception on -ERR responses returned by Redis.
executePipeline ( Predis\Connection\ConnectionInterface $connection, SplQueue $commands ) : array Implements the logic to flush the queued commands and read the responses from the current connection.
getConnection ( ) : Predis\Connection\ConnectionInterface Returns the underlying connection to be used by the pipeline.
recordCommand ( Predis\Command\CommandInterface $command ) Queues a command instance into the pipeline buffer.
throwServerExceptions ( ) : boolean Returns if the pipeline should throw exceptions on server errors.

Private Methods

Method Description
setRunning ( boolean $bool ) Marks the running status of the pipeline.

Method Details

__call() public method

Queues a command into the pipeline buffer.
public __call ( string $method, array $arguments )
$method string Command ID.
$arguments array Arguments for the command.

__construct() public method

public __construct ( Predis\ClientInterface $client )
$client Predis\ClientInterface Client instance used by the context.

exception() protected method

Throws an exception on -ERR responses returned by Redis.
protected exception ( Predis\Connection\ConnectionInterface $connection, Predis\Response\ErrorInterface $response )
$connection Predis\Connection\ConnectionInterface Redis connection that returned the error.
$response Predis\Response\ErrorInterface Instance of the error response.

execute() public method

Handles the actual execution of the whole pipeline.
public execute ( mixed $callable = null ) : array
$callable mixed Optional callback for execution.
return array

executeCommand() public method

Queues a command instance into the pipeline buffer.
public executeCommand ( Predis\Command\CommandInterface $command )
$command Predis\Command\CommandInterface Command instance to be queued in the buffer.

executePipeline() protected method

Implements the logic to flush the queued commands and read the responses from the current connection.
protected executePipeline ( Predis\Connection\ConnectionInterface $connection, SplQueue $commands ) : array
$connection Predis\Connection\ConnectionInterface Current connection instance.
$commands SplQueue Queued commands.
return array

flushPipeline() public method

Flushes the buffer holding all of the commands queued so far.
public flushPipeline ( boolean $send = true )
$send boolean Specifies if the commands in the buffer should be sent to Redis.

getClient() public method

Returns the underlying client instance used by the pipeline object.
public getClient ( ) : Predis\ClientInterface
return Predis\ClientInterface

getConnection() protected method

Returns the underlying connection to be used by the pipeline.
protected getConnection ( ) : Predis\Connection\ConnectionInterface
return Predis\Connection\ConnectionInterface

recordCommand() protected method

Queues a command instance into the pipeline buffer.
protected recordCommand ( Predis\Command\CommandInterface $command )
$command Predis\Command\CommandInterface Command to be queued in the buffer.

throwServerExceptions() protected method

Returns if the pipeline should throw exceptions on server errors.
protected throwServerExceptions ( ) : boolean
return boolean