PHP Класс Disque\Connection\Node\Node

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( Disque\Connection\Credentials $credentials, Disque\Connection\ConnectionInterface $connection )
addJobCount ( integer $jobsAdded ) Increase the node job counts by the given number
connect ( ) : array Connect to the node and return the HELLO response
execute ( Disque\Command\CommandInterface $command ) : mixed Execute a command on this Disque node
getConnection ( ) : Disque\Connection\ConnectionInterface Get the node connection
getCredentials ( ) : Disque\Connection\Credentials Get the node credentials
getHello ( ) : array Get the node's last HELLO response
getId ( ) : string Get the node ID
getJobCount ( ) : integer Get the node job count since the last reset (usually a node switch)
getPrefix ( ) : string Get the node prefix - the first 8 bytes from the ID
getPriority ( ) : integer Get the node priority as set by the cluster. 1-100, lower is better.
getTotalJobCount ( ) : integer Get the total job count since the node instantiation
isConnected ( ) : boolean Check if this object holds a working connection to Disque node
resetJobCount ( ) Reset the node job count
sayHello ( ) : array Say a new HELLO to the node and parse the response
setPriority ( integer $priority )

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

Метод Описание
authenticateWithPassword ( ) Authenticate with the node with a password, if set
connectToTheNode ( ) Connect to the node
createPrefix ( string $id ) Create a node prefix from the node ID
readPriorityFromHello ( array $hello, string $id ) : integer Read out the node's own priority from a HELLO response

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

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

public __construct ( Disque\Connection\Credentials $credentials, Disque\Connection\ConnectionInterface $connection )
$credentials Disque\Connection\Credentials
$connection Disque\Connection\ConnectionInterface

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

Increase the node job counts by the given number
public addJobCount ( integer $jobsAdded )
$jobsAdded integer

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

This method is idempotent and can be called multiple times
public connect ( ) : array
Результат array The HELLO response

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

Execute a command on this Disque node
public execute ( Disque\Command\CommandInterface $command ) : mixed
$command Disque\Command\CommandInterface
Результат mixed Response

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

Get the node connection
public getConnection ( ) : Disque\Connection\ConnectionInterface
Результат Disque\Connection\ConnectionInterface

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

Get the node credentials
public getCredentials ( ) : Disque\Connection\Credentials
Результат Disque\Connection\Credentials

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

Get the node's last HELLO response
public getHello ( ) : array
Результат array

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

Get the node ID
public getId ( ) : string
Результат string

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

Get the node job count since the last reset (usually a node switch)
public getJobCount ( ) : integer
Результат integer

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

Get the node prefix - the first 8 bytes from the ID
public getPrefix ( ) : string
Результат string

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

Get the node priority as set by the cluster. 1-100, lower is better.
public getPriority ( ) : integer
Результат integer

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

Get the total job count since the node instantiation
public getTotalJobCount ( ) : integer
Результат integer

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

Check if this object holds a working connection to Disque node
public isConnected ( ) : boolean
Результат boolean

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

Reset the node job count
public resetJobCount ( )

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

Say a new HELLO to the node and parse the response
public sayHello ( ) : array
Результат array The HELLO response

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

public setPriority ( integer $priority )
$priority integer Disque priority as revealed by a HELLO