PHP Class Predis\Transaction\MultiExec

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

Protected Properties

Свойство Type Description
$attempts
$client
$commands
$exceptions
$modeCAS
$watchKeys

Méthodes publiques

Méthode Description
__call ( string $method, array $arguments ) : mixed Dynamically invokes a Redis command with the specified arguments.
__construct ( Predis\ClientInterface $client, array $options = null )
discard ( ) : MultiExec Resets the transaction by UNWATCH-ing the keys that are being WATCHed and DISCARD-ing pending commands that have been already sent to the server.
exec ( ) : mixed Executes the whole transaction.
execute ( mixed $callable = null ) : array Handles the actual execution of the whole transaction.
executeCommand ( Predis\Command\CommandInterface $command ) Executes the specified Redis command.
multi ( ) : MultiExec Finalizes the transaction by executing MULTI on the server.
unwatch ( ) : MultiExec Executes UNWATCH.
watch ( string | array $keys ) : mixed Executes WATCH against one or more keys.

Méthodes protégées

Méthode Description
call ( string $commandID, array $arguments = [] ) : mixed Executes a Redis command bypassing the transaction logic.
configure ( Predis\ClientInterface $client, array $options ) Configures the transaction using the provided options.
executeTransactionBlock ( mixed $callable ) Passes the current transaction object to a callable block for execution.
initialize ( ) Initializes the transaction context.
reset ( ) Resets the state of the transaction.

Private Methods

Méthode Description
assertClient ( Predis\ClientInterface $client ) Checks if the passed client instance satisfies the required conditions needed to initialize the transaction object.
checkBeforeExecution ( mixed $callable ) Checks the state of the transaction before execution.
onProtocolError ( string $message ) Helper method for protocol errors encountered inside the transaction.

Method Details

__call() public méthode

Dynamically invokes a Redis command with the specified arguments.
public __call ( string $method, array $arguments ) : mixed
$method string Command ID.
$arguments array Arguments for the command.
Résultat mixed

__construct() public méthode

public __construct ( Predis\ClientInterface $client, array $options = null )
$client Predis\ClientInterface Client instance used by the transaction.
$options array Initialization options.

call() protected méthode

Executes a Redis command bypassing the transaction logic.
protected call ( string $commandID, array $arguments = [] ) : mixed
$commandID string Command ID.
$arguments array Arguments for the command.
Résultat mixed

configure() protected méthode

Configures the transaction using the provided options.
protected configure ( Predis\ClientInterface $client, array $options )
$client Predis\ClientInterface Underlying client instance.
$options array Array of options for the transaction.

discard() public méthode

Resets the transaction by UNWATCH-ing the keys that are being WATCHed and DISCARD-ing pending commands that have been already sent to the server.
public discard ( ) : MultiExec
Résultat MultiExec

exec() public méthode

Executes the whole transaction.
public exec ( ) : mixed
Résultat mixed

execute() public méthode

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

executeCommand() public méthode

Executes the specified Redis command.
public executeCommand ( Predis\Command\CommandInterface $command )
$command Predis\Command\CommandInterface Command instance.

executeTransactionBlock() protected méthode

Passes the current transaction object to a callable block for execution.
protected executeTransactionBlock ( mixed $callable )
$callable mixed Callback.

initialize() protected méthode

Initializes the transaction context.
protected initialize ( )

multi() public méthode

Finalizes the transaction by executing MULTI on the server.
public multi ( ) : MultiExec
Résultat MultiExec

reset() protected méthode

Resets the state of the transaction.
protected reset ( )

unwatch() public méthode

Executes UNWATCH.
public unwatch ( ) : MultiExec
Résultat MultiExec

watch() public méthode

Executes WATCH against one or more keys.
public watch ( string | array $keys ) : mixed
$keys string | array One or more keys.
Résultat mixed

Property Details

$attempts protected_oe property

protected $attempts

$client protected_oe property

protected $client

$commands protected_oe property

protected $commands

$exceptions protected_oe property

protected $exceptions

$modeCAS protected_oe property

protected $modeCAS

$watchKeys protected_oe property

protected $watchKeys