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::exists(int $timerId)\:\ bool
The Timer ID you want to check if it exists
if success, it returns TRUE, otherwise it returns FALSE.
Check if a timer still exists by using the Timer ID.
<?php
function run($timerId, $param1, $param2) {
var_dump($timerId);
var_dump($param);
}
$timerId = OpenSwoole\Timer::tick(1000, "run", ["param1", "param2"]);
if(OpenSwoole\Timer::exists(timerId))
{
echo 'Yes timer does exist';
}
else
{
echo 'No, timer does not exist';
}