Connection
abstract class Connection (View source)
Traits
Macroable |
Properties
static protected array | $macros | The registered string macros. | from Macroable |
protected Redis | $client | The Redis client. | |
protected string|null | $name | The Redis connection name. | |
protected Dispatcher | $events | The event dispatcher instance. |
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) Pass other method calls down to the underlying client. | |
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. | |
mixed | client() Get the underlying Redis client. | |
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. | |
mixed | command(string $method, array $parameters = []) Run a command against the Redis database. | |
void | event(mixed $event) Fire the given event if possible. | |
void | listen(Closure $callback) Register a Redis command listener with the connection. | |
string|null | getName() Get the connection name. | |
$this | setName(string $name) Set the connections name. | |
Dispatcher | getEventDispatcher() Get the event dispatcher used by the connection. | |
void | setEventDispatcher(Dispatcher $events) Set the event dispatcher instance on the connection. | |
void | unsetEventDispatcher() Unset the event dispatcher instance on the connection. |
Details
static void macro(string $name, object|callable $macro)
Register a custom macro.
static void mixin(object $mixin, bool $replace = true)
Mix another object into the class.
static bool hasMacro(string $name)
Checks if macro is registered.
static mixed __callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
mixed __call(string $method, array $parameters)
Pass other method calls down to the underlying client.
abstract 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.
mixed client()
Get the underlying Redis client.
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.
mixed command(string $method, array $parameters = [])
Run a command against the Redis database.
protected void event(mixed $event)
Fire the given event if possible.
void listen(Closure $callback)
Register a Redis command listener with the connection.
string|null getName()
Get the connection name.
$this setName(string $name)
Set the connections name.
Dispatcher getEventDispatcher()
Get the event dispatcher used by the connection.
void setEventDispatcher(Dispatcher $events)
Set the event dispatcher instance on the connection.
void unsetEventDispatcher()
Unset the event dispatcher instance on the connection.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/6.x/Illuminate/Redis/Connections/Connection.html