Redisent, a Redis interface for the modest among us

 Methods

__call()

__call($name, $args) : \Fuel\Core\Redis_Db | array

fluent This method is part of a fluent interface and will return the same instance

Parameters

$name

$args

Exceptions

\RedisException

Returns

Create a new Redis instance using the configuration values supplied

__construct(array $config) 

Parameters

$config

array

Exceptions

\RedisException

Close the open connection on class destruction

__destruct() 

Flushes the commands in the pipeline queue to Redis and returns the responses.

execute() 

see \Fuel\Core\pipeline

create an instance of the Redis class

forge(string $name, array $config) : mixed

Parameters

$name

string

$config

array

Exceptions

\RedisException

Returns

mixed

Get an instance of the Redis class

instance(string $name) : mixed

Parameters

$name

string

Exceptions

\RedisException

Returns

mixed

Returns the Redisent instance ready for pipelining.

pipeline() 

Redis commands can now be chained, and the array of the responses will be returned when execute is called.

see \Fuel\Core\execute

Alias for the redis PSUBSCRIBE command.

psubscribe(string $pattern, callable $callback) 

It allows you to listen, and have the callback called for every response.

Parameters

$pattern

string

pattern to subscribe to

$callback

callable

callback, to process the responses

Exceptions

\RedisException if writing the command failed

readResponse()

readResponse() 

 Properties

 

$connection

$connection : resource

 

Multiton pattern, keep track of all created instances

$instances 

 

Flag indicating whether or not commands are being pipelined

$pipelined : boolean

 

The queue of commands to be sent to the Redis server

$queue : array