Join 2,000+ others and never miss out on new tips, tutorials, and more.
Latest version:
pecl install openswoole-4.11.1
<?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));
}