Documentation

ReplicationInterface extends AggregateConnectionInterface

Defines a group of Redis nodes in a master / slave replication setup.

Tags
author

Daniele Alessandri suppakilla@gmail.com

Table of Contents

add()  : mixed
Adds a connection instance to the aggregate connection.
connect()  : mixed
Opens the connection to Redis.
disconnect()  : mixed
Closes the connection to Redis.
executeCommand()  : mixed
Writes a request for the given command over the connection and reads back the response returned by Redis.
getConnection()  : NodeConnectionInterface
Returns the connection instance in charge for the given command.
getConnectionById()  : NodeConnectionInterface|null
Returns a connection instance from the aggregate connection by its alias.
getCurrent()  : NodeConnectionInterface
Returns the connection instance currently in use by the aggregate connection.
getMaster()  : NodeConnectionInterface
Returns the connection instance for the master Redis node.
getSlaves()  : NodeConnectionInterface
Returns a list of connection instances to slave nodes.
isConnected()  : bool
Checks if the connection to Redis is considered open.
readResponse()  : mixed
Reads the response to the given command from the connection.
remove()  : bool
Removes the specified connection instance from the aggregate connection.
switchTo()  : mixed
Switches the internal connection instance in use.
writeRequest()  : mixed
Writes the request for the given command over the connection.

Methods

connect()

Opens the connection to Redis.

public connect() : mixed
Return values
mixed

disconnect()

Closes the connection to Redis.

public disconnect() : mixed
Return values
mixed

executeCommand()

Writes a request for the given command over the connection and reads back the response returned by Redis.

public executeCommand(CommandInterface $command) : mixed
Parameters
$command : CommandInterface

Command instance.

Return values
mixed

isConnected()

Checks if the connection to Redis is considered open.

public isConnected() : bool
Return values
bool

switchTo()

Switches the internal connection instance in use.

public switchTo(string $connection) : mixed
Parameters
$connection : string

Alias of a connection

Return values
mixed

Search results