W3cubDocs

/Laravel 8

PredisConnection

class PredisConnection extends Connection implements Connection (View source)

Traits

Macroable

Properties

static protected array $macros The registered string macros. from Macroable
protected Client $client The Predis client.
protected string|null $name The Redis connection name. from Connection
protected Dispatcher $events The event dispatcher instance. from Connection

Methods

static void macro(string $name, object|callable $macro)

Register a custom macro.

from Macroable
static void mixin(object $mixin, bool $replace = true)

Mix another object into the class.

from Macroable
static bool hasMacro(string $name)

Checks if macro is registered.

from Macroable
static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

from Macroable
mixed __call(string $method, array $parameters)

Dynamically handle calls to the class.

from Macroable
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.

from Connection
DurationLimiterBuilder throttle(string $name)

Throttle a callback for a maximum number of executions over a given duration.

from Connection
mixed client()

Get the underlying Redis client.

from Connection
void subscribe(array|string $channels, Closure $callback)

Subscribe to a set of given channels for messages.

from Connection
void psubscribe(array|string $channels, Closure $callback)

Subscribe to a set of given channels with wildcards.

from Connection
mixed command(string $method, array $parameters = [])

Run a command against the Redis database.

from Connection
void event(mixed $event)

Fire the given event if possible.

from Connection
void listen(Closure $callback)

Register a Redis command listener with the connection.

from Connection
string|null getName()

Get the connection name.

from Connection
$this setName(string $name)

Set the connections name.

from Connection
Dispatcher getEventDispatcher()

Get the event dispatcher used by the connection.

from Connection
void setEventDispatcher(Dispatcher $events)

Set the event dispatcher instance on the connection.

from Connection
void unsetEventDispatcher()

Unset the event dispatcher instance on the connection.

from Connection
void __construct(Client $client)

Create a new Predis connection.

void flushdb()

Flush the selected Redis database.

Details

static void macro(string $name, object|callable $macro)

Register a custom macro.

Parameters

string $name
object|callable $macro

Return Value

void

static void mixin(object $mixin, bool $replace = true)

Mix another object into the class.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

static bool hasMacro(string $name)

Checks if macro is registered.

Parameters

string $name

Return Value

bool

static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

mixed __call(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

void createSubscription(array|string $channels, Closure $callback, string $method = 'subscribe')

Subscribe to a set of given channels for messages.

Parameters

array|string $channels
Closure $callback
string $method

Return Value

void

ConcurrencyLimiterBuilder funnel(string $name)

Funnel a callback for a maximum number of simultaneous executions.

Parameters

string $name

Return Value

ConcurrencyLimiterBuilder

DurationLimiterBuilder throttle(string $name)

Throttle a callback for a maximum number of executions over a given duration.

Parameters

string $name

Return Value

DurationLimiterBuilder

mixed client()

Get the underlying Redis client.

Return Value

mixed

void subscribe(array|string $channels, Closure $callback)

Subscribe to a set of given channels for messages.

Parameters

array|string $channels
Closure $callback

Return Value

void

void psubscribe(array|string $channels, Closure $callback)

Subscribe to a set of given channels with wildcards.

Parameters

array|string $channels
Closure $callback

Return Value

void

mixed command(string $method, array $parameters = [])

Run a command against the Redis database.

Parameters

string $method
array $parameters

Return Value

mixed

protected void event(mixed $event)

Fire the given event if possible.

Parameters

mixed $event

Return Value

void

void listen(Closure $callback)

Register a Redis command listener with the connection.

Parameters

Closure $callback

Return Value

void

string|null getName()

Get the connection name.

Return Value

string|null

$this setName(string $name)

Set the connections name.

Parameters

string $name

Return Value

$this

Dispatcher getEventDispatcher()

Get the event dispatcher used by the connection.

Return Value

Dispatcher

void setEventDispatcher(Dispatcher $events)

Set the event dispatcher instance on the connection.

Parameters

Dispatcher $events

Return Value

void

void unsetEventDispatcher()

Unset the event dispatcher instance on the connection.

Return Value

void

void __construct(Client $client)

Create a new Predis connection.

Parameters

Client $client

Return Value

void

void flushdb()

Flush the selected Redis database.

Return Value

void

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Redis/Connections/PredisConnection.html