Join 4,000+ others and never miss out on new tips, tutorials, and more.
4.x is outdated, please check the latest version 22.x
Latest version:
pecl install openswoole-22.1.2
<?php Swoole\Server->on('Timer', Callable $callback)
The event callback name.
Callable event function.
If success, it returns true
, otherwise it returns false
.
Execute the callback function when receiving Timer
tick events.
A Timer
can be added to the server with $server->addTimer
method.
<?php
function(Swoole\Server $server, int $interval)
{
// ...
}