PHP 클래스 PHPDaemon\Core\Timer

저자: Vasily Zorin ([email protected])
상속: use trait PHPDaemon\Traits\ClassWatchdog, use trait PHPDaemon\Traits\StaticObjectWatchdog, use trait PHPDaemon\Traits\EventLoopContainer
파일 보기 프로젝트 열기: kakserpom/phpdaemon 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$cb Callback
$finished Is the timer finished?
$id Timer id
$lastTimeout Current timeout holder
$priority Priority

보호된 프로퍼티들

프로퍼티 타입 설명
$counter Counter
$ev Event resource
$list List of timers

공개 메소드들

메소드 설명
__construct ( callable $cb, integer $timeout = null, integer | string $id = null, integer $priority = null ) Constructor
__destruct ( ) : void Destructor
add ( callable $cb, integer $timeout = null, integer | string $id = null, integer $priority = null ) : integer | string Adds timer
cancel ( ) : void Cancels timer
cancelTimeout ( integer | string $id ) : void Cancels timer by ID
eventCall ( ) : void Called when timer is triggered
finish ( ) : void Finishes timer
free ( ) : void Frees the timer
remove ( integer | string $id ) : void Removes timer by ID
setPriority ( integer $priority ) : void Set prioriry
setTimeout ( integer | string $id, integer $timeout = null ) : boolean Sets timeout
timeout ( integer $timeout = null ) : void Sets timeout

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( callable $cb, integer $timeout = null, integer | string $id = null, integer $priority = null )
$cb callable Callback
$timeout integer Timeout
$id integer | string Timer ID
$priority integer Priority

__destruct() 공개 메소드

Destructor
public __destruct ( ) : void
리턴 void

add() 공개 정적인 메소드

Adds timer
public static add ( callable $cb, integer $timeout = null, integer | string $id = null, integer $priority = null ) : integer | string
$cb callable Callback
$timeout integer Timeout
$id integer | string Timer ID
$priority integer Priority
리턴 integer | string Timer ID

cancel() 공개 메소드

Cancels timer
public cancel ( ) : void
리턴 void

cancelTimeout() 공개 정적인 메소드

Cancels timer by ID
public static cancelTimeout ( integer | string $id ) : void
$id integer | string Timer ID
리턴 void

eventCall() 공개 메소드

Called when timer is triggered
public eventCall ( ) : void
리턴 void

finish() 공개 메소드

Finishes timer
public finish ( ) : void
리턴 void

free() 공개 메소드

Frees the timer
public free ( ) : void
리턴 void

remove() 공개 정적인 메소드

Removes timer by ID
public static remove ( integer | string $id ) : void
$id integer | string Timer ID
리턴 void

setPriority() 공개 메소드

Set prioriry
public setPriority ( integer $priority ) : void
$priority integer Priority
리턴 void

setTimeout() 공개 정적인 메소드

Sets timeout
public static setTimeout ( integer | string $id, integer $timeout = null ) : boolean
$id integer | string Timer ID
$timeout integer Timeout
리턴 boolean

timeout() 공개 메소드

Sets timeout
public timeout ( integer $timeout = null ) : void
$timeout integer Timeout
리턴 void

프로퍼티 상세

$cb 공개적으로 프로퍼티

Callback
public $cb

$counter 보호되어 있는 정적으로 프로퍼티

Counter
protected static $counter

$ev 보호되어 있는 프로퍼티

Event resource
protected $ev

$finished 공개적으로 프로퍼티

Is the timer finished?
public $finished

$id 공개적으로 프로퍼티

Timer id
public $id

$lastTimeout 공개적으로 프로퍼티

Current timeout holder
public $lastTimeout

$list 보호되어 있는 정적으로 프로퍼티

List of timers
protected static $list

$priority 공개적으로 프로퍼티

Priority
public $priority