Documentation

MultiExec
in package
implements ClientContextInterface

Client-side abstraction of a Redis transaction based on MULTI / EXEC.

Tags
author

Daniele Alessandri suppakilla@gmail.com

Interfaces, Classes and Traits

ClientContextInterface
Interface defining a client-side context such as a pipeline or transaction.

Table of Contents

$attempts  : mixed
$client  : mixed
$commands  : mixed
$exceptions  : mixed
$modeCAS  : mixed
$watchKeys  : mixed
$state  : mixed
__call()  : mixed
Dynamically invokes a Redis command with the specified arguments.
__construct()  : mixed
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()  : array<string|int, mixed>
Handles the actual execution of the whole transaction.
executeCommand()  : $this|mixed
Executes the specified Redis command.
multi()  : MultiExec
Finalizes the transaction by executing MULTI on the server.
unwatch()  : MultiExec
Executes UNWATCH.
watch()  : mixed
Executes WATCH against one or more keys.
call()  : mixed
Executes a Redis command bypassing the transaction logic.
configure()  : mixed
Configures the transaction using the provided options.
executeTransactionBlock()  : mixed
Passes the current transaction object to a callable block for execution.
initialize()  : mixed
Initializes the transaction context.
reset()  : mixed
Resets the state of the transaction.
assertClient()  : mixed
Checks if the passed client instance satisfies the required conditions needed to initialize the transaction object.
checkBeforeExecution()  : mixed
Checks the state of the transaction before execution.
onProtocolError()  : mixed
Helper method for protocol errors encountered inside the transaction.

Properties

$exceptions

protected mixed $exceptions = true

$watchKeys

protected mixed $watchKeys = array()

Methods

__call()

Dynamically invokes a Redis command with the specified arguments.

public __call(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
$method : string

Command ID.

$arguments : array<string|int, mixed>

Arguments for the command.

Return values
mixed

__construct()

public __construct(ClientInterface $client[, array<string|int, mixed> $options = null ]) : mixed
Parameters
$client : ClientInterface

Client instance used by the transaction.

$options : array<string|int, mixed> = null

Initialization options.

Return values
mixed

discard()

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
Return values
MultiExec

exec()

Executes the whole transaction.

public exec() : mixed
Return values
mixed

watch()

Executes WATCH against one or more keys.

public watch(string|array<string|int, mixed> $keys) : mixed
Parameters
$keys : string|array<string|int, mixed>

One or more keys.

Tags
throws
NotSupportedException
throws
ClientException
Return values
mixed

call()

Executes a Redis command bypassing the transaction logic.

protected call(string $commandID[, array<string|int, mixed> $arguments = array() ]) : mixed
Parameters
$commandID : string

Command ID.

$arguments : array<string|int, mixed> = array()

Arguments for the command.

Tags
throws
ServerException
Return values
mixed

configure()

Configures the transaction using the provided options.

protected configure(ClientInterface $client, array<string|int, mixed> $options) : mixed
Parameters
$client : ClientInterface

Underlying client instance.

$options : array<string|int, mixed>

Array of options for the transaction.

Return values
mixed

executeTransactionBlock()

Passes the current transaction object to a callable block for execution.

protected executeTransactionBlock(mixed $callable) : mixed
Parameters
$callable : mixed

Callback.

Tags
throws
CommunicationException
throws
ServerException
Return values
mixed

initialize()

Initializes the transaction context.

protected initialize() : mixed
Return values
mixed

reset()

Resets the state of the transaction.

protected reset() : mixed
Return values
mixed

assertClient()

Checks if the passed client instance satisfies the required conditions needed to initialize the transaction object.

private assertClient(ClientInterface $client) : mixed
Parameters
$client : ClientInterface

Client instance used by the transaction object.

Tags
throws
NotSupportedException
Return values
mixed

checkBeforeExecution()

Checks the state of the transaction before execution.

private checkBeforeExecution(mixed $callable) : mixed
Parameters
$callable : mixed

Callback for execution.

Tags
throws
InvalidArgumentException
throws
ClientException
Return values
mixed

onProtocolError()

Helper method for protocol errors encountered inside the transaction.

private onProtocolError(string $message) : mixed
Parameters
$message : string

Error message.

Return values
mixed

Search results