OpenSwoole\Timer::list

Latest version: pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5

Declaration

<?php OpenSwoole\Timer::list()\:\ OpenSwoole\Timer\Iterator

Parameters

none

Return

OpenSwoole\Timer\Iterator

A iterator which can be used within a foreach loop to process the active timers for the current worker process

Description

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

Example

<?php

// Show information for currently active timers
foreach (OpenSwoole\Timer::list() as $timerId)
{
    var_dump(OpenSwoole\Timer::info($timerId));
}
Last updated on September 1, 2022