Join 4,000+ others and never miss out on new tips, tutorials, and more.
Latest version:
pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5
<?php OpenSwoole\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(OpenSwoole\Server $server, int $interval)
{
// ...
}