xref: /php-uv/tests/101-uv-idle.phpt (revision d3d245d4)
1--TEST--
2Check for uv_idle_init and uv_idle_start
3--FILE--
4<?php
5$loop = uv_default_loop();
6$idle = uv_idle_init();
7
8$i = 0;
9uv_idle_start($idle, function($stat)
10   use (&$i, $idle, $loop) {
11
12    echo "count: {$i}" . PHP_EOL;
13    $i++;
14
15    if ($i > 3) {
16        uv_idle_stop($idle);
17    }
18});
19
20uv_run();
21
22echo "finished";
23--EXPECT--
24count: 0
25count: 1
26count: 2
27count: 3
28finished
29