PHP Класс Predis\Connection\PhpiredisSocketConnection

This class is intended to provide an optional low-overhead alternative for processing responses from Redis compared to the standard pure-PHP classes. Differences in speed when dealing with short inline responses are practically nonexistent, the actual speed boost is for big multibulk responses when this protocol processor can parse and return responses very fast. For instructions on how to build and install the phpiredis extension, please consult the repository of the project. The connection parameters supported by this class are: - scheme: it can be either 'tcp' or 'unix'. - host: hostname or IP address of the server. - port: TCP port of the server. - path: path of a UNIX domain socket when scheme is 'unix'. - timeout: timeout to perform the connection. - read_write_timeout: timeout of read / write operations.
Автор: Daniele Alessandri ([email protected])
Наследование: extends AbstractConnection
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( Predis\Connection\ParametersInterface $parameters )
__destruct ( ) Disconnects from the server and destroys the underlying resource and the protocol reader resource when PHP's garbage collector kicks in.
__wakeup ( )
connect ( )
disconnect ( )
read ( )
writeRequest ( Predis\Command\CommandInterface $command )

Защищенные методы

Метод Описание
assertExtensions ( ) Checks if the socket and phpiredis extensions are loaded in PHP.
assertParameters ( Predis\Connection\ParametersInterface $parameters )
createResource ( )
getAddress ( Predis\Connection\ParametersInterface $parameters ) : string Gets the address of an host from connection parameters.
getErrorHandler ( ) : Closure Returns the handler used by the protocol reader for error responses.
getReader ( ) : resource Returns the underlying protocol reader resource.
getStatusHandler ( ) : Closure Returns the handler used by the protocol reader for inline responses.
write ( $buffer )

Приватные методы

Метод Описание
connectWithTimeout ( resource $socket, string $address, Predis\Connection\ParametersInterface $parameters ) : string Opens the actual connection to the server with a timeout.
createReader ( ) : resource Creates a new instance of the protocol reader resource.
emitSocketError ( ) Helper method used to throw exceptions on socket errors.
setSocketOptions ( resource $socket, Predis\Connection\ParametersInterface $parameters ) Sets options on the socket resource from the connection parameters.

Описание методов

__construct() публичный Метод

public __construct ( Predis\Connection\ParametersInterface $parameters )
$parameters Predis\Connection\ParametersInterface

__destruct() публичный Метод

Disconnects from the server and destroys the underlying resource and the protocol reader resource when PHP's garbage collector kicks in.
public __destruct ( )

__wakeup() публичный Метод

public __wakeup ( )

assertExtensions() защищенный Метод

Checks if the socket and phpiredis extensions are loaded in PHP.
protected assertExtensions ( )

assertParameters() защищенный Метод

protected assertParameters ( Predis\Connection\ParametersInterface $parameters )
$parameters Predis\Connection\ParametersInterface

connect() публичный Метод

public connect ( )

createResource() защищенный Метод

protected createResource ( )

disconnect() публичный Метод

public disconnect ( )

getAddress() защищенный статический Метод

Gets the address of an host from connection parameters.
protected static getAddress ( Predis\Connection\ParametersInterface $parameters ) : string
$parameters Predis\Connection\ParametersInterface Parameters used to initialize the connection.
Результат string

getErrorHandler() защищенный Метод

Returns the handler used by the protocol reader for error responses.
protected getErrorHandler ( ) : Closure
Результат Closure

getReader() защищенный Метод

Returns the underlying protocol reader resource.
protected getReader ( ) : resource
Результат resource

getStatusHandler() защищенный Метод

Returns the handler used by the protocol reader for inline responses.
protected getStatusHandler ( ) : Closure
Результат Closure

read() публичный Метод

public read ( )

write() защищенный Метод

protected write ( $buffer )

writeRequest() публичный Метод

public writeRequest ( Predis\Command\CommandInterface $command )
$command Predis\Command\CommandInterface