ReplicationStrategy
in package
Defines a strategy for master/slave replication.
Tags
Table of Contents
- $disallowed : mixed
- $readonly : mixed
- $readonlySHA1 : mixed
- __construct() : mixed
- isDisallowedOperation() : bool
- Returns if the specified command is not allowed for execution in a master / slave replication context.
- isReadOperation() : bool
- Returns if the specified command will perform a read-only operation on Redis or not.
- setCommandReadOnly() : mixed
- Marks a command as a read-only operation.
- setScriptReadOnly() : mixed
- Marks a Lua script for EVAL and EVALSHA as a read-only operation. When the behaviour of a script can be decided only at runtime depending on its arguments, a callable object can be provided to dynamically check if the passed instance of EVAL or EVALSHA performs write operations or not.
- getDisallowedOperations() : array<string|int, mixed>
- Returns the default list of disallowed commands.
- getReadOnlyOperations() : array<string|int, mixed>
- Returns the default list of commands performing read-only operations.
- isBitfieldReadOnly() : bool
- Checks if BITFIELD performs a read-only operation by looking for certain SET and INCRYBY modifiers in the arguments array of the command.
- isGeoradiusReadOnly() : bool
- Checks if a GEORADIUS command is a readable operation by parsing the arguments array of the specified commad instance.
Properties
$disallowed
protected
mixed
$disallowed
$readonly
protected
mixed
$readonly
$readonlySHA1
protected
mixed
$readonlySHA1
Methods
__construct()
public
__construct() : mixed
Return values
mixed —isDisallowedOperation()
Returns if the specified command is not allowed for execution in a master / slave replication context.
public
isDisallowedOperation(CommandInterface $command) : bool
Parameters
- $command : CommandInterface
-
Command instance.
Return values
bool —isReadOperation()
Returns if the specified command will perform a read-only operation on Redis or not.
public
isReadOperation(CommandInterface $command) : bool
Parameters
- $command : CommandInterface
-
Command instance.
Tags
Return values
bool —setCommandReadOnly()
Marks a command as a read-only operation.
public
setCommandReadOnly(string $commandID[, mixed $readonly = true ]) : mixed
When the behavior of a command can be decided only at runtime depending on its arguments, a callable object can be provided to dynamically check if the specified command performs a read or a write operation.
Parameters
- $commandID : string
-
Command ID.
- $readonly : mixed = true
-
A boolean value or a callable object.
Return values
mixed —setScriptReadOnly()
Marks a Lua script for EVAL and EVALSHA as a read-only operation. When the behaviour of a script can be decided only at runtime depending on its arguments, a callable object can be provided to dynamically check if the passed instance of EVAL or EVALSHA performs write operations or not.
public
setScriptReadOnly(string $script[, mixed $readonly = true ]) : mixed
Parameters
- $script : string
-
Body of the Lua script.
- $readonly : mixed = true
-
A boolean value or a callable object.
Return values
mixed —getDisallowedOperations()
Returns the default list of disallowed commands.
protected
getDisallowedOperations() : array<string|int, mixed>
Return values
array<string|int, mixed> —getReadOnlyOperations()
Returns the default list of commands performing read-only operations.
protected
getReadOnlyOperations() : array<string|int, mixed>
Return values
array<string|int, mixed> —isBitfieldReadOnly()
Checks if BITFIELD performs a read-only operation by looking for certain SET and INCRYBY modifiers in the arguments array of the command.
protected
isBitfieldReadOnly(CommandInterface $command) : bool
Parameters
- $command : CommandInterface
-
Command instance.
Return values
bool —isGeoradiusReadOnly()
Checks if a GEORADIUS command is a readable operation by parsing the arguments array of the specified commad instance.
protected
isGeoradiusReadOnly(CommandInterface $command) : bool
Parameters
- $command : CommandInterface
-
Command instance.