mirror of
https://github.com/danog/ext-uv.git
synced 2024-12-02 09:27:58 +01:00
24 lines
381 B
PHP
24 lines
381 B
PHP
<?php
|
|
$loop = uv_default_loop();
|
|
$check = uv_check_init($loop);
|
|
|
|
$idle = uv_idle_init();
|
|
|
|
$i = 0;
|
|
uv_idle_start($idle, function($stat) use (&$i, $idle, $loop){
|
|
echo "count: {$i}" . PHP_EOL;
|
|
$i++;
|
|
|
|
if ($i > 3) {
|
|
uv_idle_stop($idle);
|
|
uv_unref($loop);
|
|
}
|
|
sleep(1);
|
|
});
|
|
|
|
uv_check_start($check, function($status){
|
|
echo "Hello";
|
|
});
|
|
|
|
uv_run();
|