PHP Class Predis\Pipeline\Pipeline

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

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

Méthode Description
setRunning ( boolean $bool ) Marks the running status of the pipeline.

Method Details

__call() public méthode

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 méthode

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

exception() protected méthode

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 méthode

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

executeCommand() public méthode

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 méthode

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.
Résultat array

flushPipeline() public méthode

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 méthode

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

getConnection() protected méthode

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

recordCommand() protected méthode

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 méthode

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