PHP 클래스 Disque\Connection\Node\Node

파일 보기 프로젝트 열기: mariano/disque-php 1 사용 예제들

공개 메소드들

메소드 설명
__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