\Workerman\LibTimer

Timer.

example: Workerman\Lib\Timer::add($time_interval, callback, array($arg1, $arg2..));

Summary

Methods
Properties
Constants
init()
signalHandle()
add()
tick()
del()
delAll()
No public properties found
No constants found
No protected methods found
$_tasks
$_event
N/A
No private methods found
No private properties found
N/A

Properties

$_tasks

$_tasks : array

Tasks that based on ALARM signal.

[ run_time => [[$func, $args, $persistent, time_interval],[$func, $args, $persistent, time_interval],..]], run_time => [[$func, $args, $persistent, time_interval],[$func, $args, $persistent, time_interval],..]], .. ]

Type

array

Methods

signalHandle()

signalHandle() : void

ALARM signal handler.

add()

add(float  $time_interval, callable  $func, mixed  $args = array(), boolean  $persistent = true) : \Workerman\Lib\int/false

Add a timer.

Parameters

float $time_interval
callable $func
mixed $args
boolean $persistent

Returns

\Workerman\Lib\int/false

tick()

tick() : void

Tick.

del()

del(mixed  $timer_id) : boolean

Remove a timer.

Parameters

mixed $timer_id

Returns

boolean

delAll()

delAll() : void

Remove all timers.