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