ext-uv/examples/check.php

24 lines
387 B
PHP
Raw Normal View History

2012-06-17 16:18:33 +02:00
<?php
$loop = uv_default_loop();
$check = uv_check_init($loop);
$idle = uv_idle_init();
$i = 0;
2020-02-15 22:36:03 +01:00
uv_idle_start($idle, function($status) use (&$i, $idle, $loop){
2012-06-17 16:18:33 +02:00
echo "count: {$i}" . PHP_EOL;
$i++;
if ($i > 3) {
uv_idle_stop($idle);
}
sleep(1);
});
2020-02-15 22:36:03 +01:00
uv_check_start($check, function($check) {
echo "Hello\n";
uv_check_stop($check);
2012-06-17 16:18:33 +02:00
});
uv_run();