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\Timer::list()\:\ Swoole\Timer\Iterator
A iterator which can be used within a foreach
loop to process the active timers for the current worker process
List all the timers within the current worker process, a Swoole\Timer\Iterator
is returned which you can use within a foreach
loop to process all the active timers.
Swoole >= v4.4.0 is required
<?php
// Show information for currently active timers
foreach (Swoole\Timer::list() as $timerId)
{
var_dump(Swoole\Timer::info($timerId));
}