PHP Class Aerys\Ticker

Inheritance: implements aerys\ServerObserver, use trait Struct
Show file Open project: amphp/aerys

Public Properties

Property Type Description
$currentHttpDate
$currentTime

Public Methods

Method Description
__construct ( Psr\Log\LoggerInterface $logger )
update ( Server $server ) : Promise
updateTime ( ) : void Updates the context with the current time
use ( callable $useCallback ) : void Add a callback to invoke each time the time context updates

Private Methods

Method Description
tryUseCallback ( callable $useCallback )

Method Details

__construct() public method

public __construct ( Psr\Log\LoggerInterface $logger )
$logger Psr\Log\LoggerInterface

update() public method

public update ( Server $server ) : Promise
$server Server
return Promise

updateTime() public method

Updates the context with the current time
public updateTime ( ) : void
return void

use() public method

Callbacks are invoked with two parameters: currentTime and currentHttpDate.
public use ( callable $useCallback ) : void
$useCallback callable
return void

Property Details

$currentHttpDate public property

public $currentHttpDate

$currentTime public property

public $currentTime