xref: /php-uv/examples/check.php (revision 99312394)
1<?php
2$loop = uv_default_loop();
3$check = uv_check_init($loop);
4
5$idle = uv_idle_init();
6
7$i = 0;
8uv_idle_start($idle, function($status) use (&$i, $idle, $loop){
9    echo "count: {$i}" . PHP_EOL;
10    $i++;
11
12    if ($i > 3) {
13        uv_idle_stop($idle);
14    }
15    sleep(1);
16});
17
18uv_check_start($check, function($check) {
19    echo "Hello\n";
20    uv_check_stop($check);
21});
22
23uv_run();
24