PHP Class PHPDaemon\Network\ClientConnection

Author: Vasily Zorin ([email protected])
Inheritance: extends Connection
Afficher le fichier Open project: kakserpom/phpdaemon Class Usage Examples

Protected Properties

Свойство Type Description
$acquired Acquired?
$busy Busy?
$maxQueue
$noSAF No Send-and-Forget?
$onResponse Stack of onResponse callbacks
$timeout Timeout

Méthodes publiques

Méthode Description
__construct ( resource $fd, mixed $pool = null ) Constructor
acquire ( ) : void Acquire the connection
checkFree ( ) : void Set connection free/busy according to onResponse emptiness and ->finished
getQueueLength ( ) : integer getQueueLength
isBusy ( ) : boolean Busy?
isQueueEmpty ( ) : boolean isQueueEmpty
onFinish ( ) : void Called when connection finishes
onReady ( ) : void Called when the connection is handshaked (at low-level), and peer is ready to recv. data
onResponse ( callable $cb ) : void Push callback to onReponse stack
release ( ) : void Release the connection
setFree ( boolean $free = true ) : void Set connection free/busy

Method Details

__construct() public méthode

Constructor
public __construct ( resource $fd, mixed $pool = null )
$fd resource File descriptor
$pool mixed ConnectionPool

acquire() public méthode

Acquire the connection
public acquire ( ) : void
Résultat void

checkFree() public méthode

Set connection free/busy according to onResponse emptiness and ->finished
public checkFree ( ) : void
Résultat void

getQueueLength() public méthode

getQueueLength
public getQueueLength ( ) : integer
Résultat integer

isBusy() public méthode

Busy?
public isBusy ( ) : boolean
Résultat boolean

isQueueEmpty() public méthode

isQueueEmpty
public isQueueEmpty ( ) : boolean
Résultat boolean

onFinish() public méthode

Called when connection finishes
public onFinish ( ) : void
Résultat void

onReady() public méthode

Called when the connection is handshaked (at low-level), and peer is ready to recv. data
public onReady ( ) : void
Résultat void

onResponse() public méthode

Push callback to onReponse stack
public onResponse ( callable $cb ) : void
$cb callable Callback
Résultat void

release() public méthode

Release the connection
public release ( ) : void
Résultat void

setFree() public méthode

Set connection free/busy
public setFree ( boolean $free = true ) : void
$free boolean Free?
Résultat void

Property Details

$acquired protected_oe property

Acquired?
protected $acquired

$busy protected_oe property

Busy?
protected $busy

$maxQueue protected_oe property

protected $maxQueue

$noSAF protected_oe property

No Send-and-Forget?
protected $noSAF

$onResponse protected_oe property

Stack of onResponse callbacks
protected $onResponse

$timeout protected_oe property

Timeout
protected $timeout