PHP Class Phergie_Plugin_Ping, phergie

Author: Phergie Development Team ([email protected])
Inheritance: extends Phergie_Plugin_Abstract
Show file Open project: phergie/phergie

Protected Properties

Property Type Description
$lastEvent integer Timestamp for the last instance in which an event was received
$lastPing integer Timestamp for the last instance in which a PING was sent

Public Methods

Method Description
getLastEvent ( ) : integer Gets the last event time lastEvent needs exposing for things such as unit testing
getLastPing ( ) : integer Gets the last ping time lastPing needs exposing for things such as unit testing
onConnect ( ) : void Initialize event timestamps upon connecting to the server.
onTick ( ) : void Performs a self ping if the event threshold has been exceeded or issues a termination command if the ping threshold has been exceeded.
preEvent ( ) : void Updates the timestamp since the last received event when a new event arrives. Also, clears the ping time as well.
setLastEvent ( integer | null $event = null ) : self Set the last event time lastEvent needs to be exposed for unit testing
setLastPing ( integer | null $ping = null ) : self Set the last ping time lastPing needs to be exposed for unit testing

Method Details

getLastEvent() public method

Gets the last event time lastEvent needs exposing for things such as unit testing
public getLastEvent ( ) : integer
return integer timestamp of last ping

getLastPing() public method

Gets the last ping time lastPing needs exposing for things such as unit testing
public getLastPing ( ) : integer
return integer timestamp of last ping

onConnect() public method

Initialize event timestamps upon connecting to the server.
public onConnect ( ) : void
return void

onTick() public method

Performs a self ping if the event threshold has been exceeded or issues a termination command if the ping threshold has been exceeded.
public onTick ( ) : void
return void

preEvent() public method

Updates the timestamp since the last received event when a new event arrives. Also, clears the ping time as well.
public preEvent ( ) : void
return void

setLastEvent() public method

Set the last event time lastEvent needs to be exposed for unit testing
public setLastEvent ( integer | null $event = null ) : self
$event integer | null timestamp of last ping
return self

setLastPing() public method

Set the last ping time lastPing needs to be exposed for unit testing
public setLastPing ( integer | null $ping = null ) : self
$ping integer | null timestamp of last ping
return self

Property Details

$lastEvent protected property

Timestamp for the last instance in which an event was received
protected int $lastEvent
return integer

$lastPing protected property

Timestamp for the last instance in which a PING was sent
protected int $lastPing
return integer