2012-07-08 18:27:02 +02:00
|
|
|
--TEST--
|
|
|
|
Check for fs poll
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
define("FIXTURE_PATH", dirname(__FILE__) . "/fixtures/poll");
|
|
|
|
|
|
|
|
$poll = uv_fs_poll_init(uv_default_loop());
|
|
|
|
|
|
|
|
fclose(fopen(FIXTURE_PATH, "w+"));
|
|
|
|
|
|
|
|
$i = 0;
|
2015-01-18 02:58:40 +01:00
|
|
|
uv_fs_poll_start($poll,function($rsc,$stat,$p,$c) use (&$i) {
|
2012-07-08 18:27:02 +02:00
|
|
|
echo "OK";
|
|
|
|
|
|
|
|
if ($i > 3) {
|
|
|
|
uv_fs_poll_stop($rsc);
|
|
|
|
uv_unref($rsc);
|
|
|
|
}
|
|
|
|
$i++;
|
|
|
|
}, FIXTURE_PATH, 1);
|
|
|
|
|
|
|
|
$timer = uv_timer_init();
|
2015-01-18 02:58:40 +01:00
|
|
|
uv_timer_start($timer, 100, 100, function($timer) use (&$i) {
|
2012-07-08 18:27:02 +02:00
|
|
|
$fp = fopen(FIXTURE_PATH, "w+");
|
|
|
|
fwrite($fp,"hoge");
|
|
|
|
fclose($fp);
|
|
|
|
|
2012-07-12 17:29:00 +02:00
|
|
|
if ($i > 4) {
|
2012-07-08 18:27:02 +02:00
|
|
|
uv_timer_stop($timer);
|
|
|
|
uv_unref($timer);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
uv_run();
|
|
|
|
--EXPECT--
|
2015-01-18 02:58:40 +01:00
|
|
|
OKOKOKOKOK
|