PhpRedisClusterConnection
class PhpRedisClusterConnection extends PhpRedisConnection (View source)
Traits
Properties
static protected array | $macros | The registered string macros. |
from Macroable |
protected RedisCluster | $client | The RedisCluster client. |
|
protected string|null | $name | The Redis connection name. |
from Connection |
protected Dispatcher|null | $events | The event dispatcher instance. |
from Connection |
protected bool|null | $supportsPacking | Indicates if Redis supports packing. |
from PacksPhpRedisValues |
protected bool|null | $supportsLzf | Indicates if Redis supports LZF compression. |
from PacksPhpRedisValues |
protected bool|null | $supportsZstd | Indicates if Redis supports Zstd compression. |
from PacksPhpRedisValues |
protected callable | $connector | The connection creation callback. |
from PhpRedisConnection |
protected array | $config | The connection configuration array. |
from PhpRedisConnection |
protected string|array | $defaultNode | The default node to use from the cluster. |
Methods
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Subscribe to a set of given channels for messages.
Funnel a callback for a maximum number of simultaneous executions.
Throttle a callback for a maximum number of executions over a given duration.
Subscribe to a set of given channels for messages.
Subscribe to a set of given channels with wildcards.
Run a command against the Redis database.
Parse the command's parameters for event dispatching.
Prepares the given values to be used with the eval
command, including serialization and compression.
Execute the given callback without serialization or compression when applicable.
Determine if the current PhpRedis extension version supports packing.
Determine if the current PhpRedis extension version supports LZF compression.
Determine if the current PhpRedis extension version supports Zstd compression.
Determine if the PhpRedis extension version is at least the given version.
Create a new PhpRedis connection.
Set the string value in the argument as the value of the key.
Set the given key if it doesn't exist.
Get the value of the given hash fields.
Set the given hash fields to their respective values.
Set the given hash field if it doesn't exist.
Removes the first count occurrences of the value element from the list.
Removes and returns the first element of the list stored at key.
Removes and returns the last element of the list stored at key.
Removes and returns a random element from the set value at key.
Add one or more members to a sorted set or update its score if it already exists.
Return elements with score between $min and $max.
Return elements with score between $min and $max.
Find the intersection between sets and store in a new set.
Find the union between sets and store in a new set.
Scan all keys based on the given options.
Scans the given set for all values based on options.
Scans the given hash for all values based on options.
Scans the given set for all values based on options.
Execute commands in a pipeline.
Execute commands in a transaction.
Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.
Evaluate a script and return its result.
Flush the selected Redis database on all master nodes.
Details
void
createSubscription(array|string $channels, Closure $callback, string $method = 'subscribe')
Subscribe to a set of given channels for messages.
ConcurrencyLimiterBuilder
funnel(string $name)
Funnel a callback for a maximum number of simultaneous executions.
DurationLimiterBuilder
throttle(string $name)
Throttle a callback for a maximum number of executions over a given duration.
void
subscribe(array|string $channels, Closure $callback)
Subscribe to a set of given channels for messages.
void
psubscribe(array|string $channels, Closure $callback)
Subscribe to a set of given channels with wildcards.
protected array
parseParametersForEvent(array $parameters)
Parse the command's parameters for event dispatching.
protected void
event(mixed $event)
deprecated
deprecated since Laravel 11.x
Fire the given event if possible.
array
pack(array $values)
Prepares the given values to be used with the eval
command, including serialization and compression.
mixed
withoutSerializationOrCompression(callable $callback)
Execute the given callback without serialization or compression when applicable.
protected bool
supportsPacking()
Determine if the current PhpRedis extension version supports packing.
protected bool
supportsLzf()
Determine if the current PhpRedis extension version supports LZF compression.
protected bool
supportsZstd()
Determine if the current PhpRedis extension version supports Zstd compression.
protected bool
phpRedisVersionAtLeast(string $version)
Determine if the PhpRedis extension version is at least the given version.
__construct(Redis $client, callable|null $connector = null, array $config = [])
Create a new PhpRedis connection.
bool
set(string $key, mixed $value, string|null $expireResolution = null, int|null $expireTTL = null, string|null $flag = null)
Set the string value in the argument as the value of the key.
int|false
lrem(string $key, int $count, mixed $value)
Removes the first count occurrences of the value element from the list.
array|null
blpop(mixed ...$arguments)
Removes and returns the first element of the list stored at key.
array|null
brpop(mixed ...$arguments)
Removes and returns the last element of the list stored at key.
mixed|false
spop(string $key, int|null $count = 1)
Removes and returns a random element from the set value at key.
int
zadd(string $key, mixed ...$dictionary)
Add one or more members to a sorted set or update its score if it already exists.
array
zrangebyscore(string $key, mixed $min, mixed $max, array $options = [])
Return elements with score between $min and $max.
array
zrevrangebyscore(string $key, mixed $min, mixed $max, array $options = [])
Return elements with score between $min and $max.
int
zinterstore(string $output, array $keys, array $options = [])
Find the intersection between sets and store in a new set.
int
zunionstore(string $output, array $keys, array $options = [])
Find the union between sets and store in a new set.
mixed
zscan(string $key, mixed $cursor, array $options = [])
Scans the given set for all values based on options.
mixed
hscan(string $key, mixed $cursor, array $options = [])
Scans the given hash for all values based on options.
mixed
sscan(string $key, mixed $cursor, array $options = [])
Scans the given set for all values based on options.
mixed
evalsha(string $script, int $numkeys, mixed ...$arguments)
Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.