ext-uv/tests/800-uv_queue_work.phpt

26 lines
403 B
Plaintext
Raw Permalink Normal View History

2012-07-07 15:57:42 +02:00
--TEST--
Check for uv_queue_work
2014-01-04 10:36:14 +01:00
--SKIPIF--
<?php
ob_start();
phpinfo();
$data = ob_get_clean();
2019-04-28 14:13:47 +02:00
if (!preg_match("/Thread Safety.+?enabled/", $data) || PHP_VERSION_ID >= 80000) {
2014-01-04 10:36:14 +01:00
echo "skip";
}
2012-07-07 15:57:42 +02:00
--FILE--
<?php
$loop = uv_default_loop();
2015-01-18 02:58:40 +01:00
$a = function() {
2012-07-07 15:57:42 +02:00
echo "[queue]";
};
2015-01-18 02:58:40 +01:00
$b = function() {
2012-07-07 15:57:42 +02:00
echo "[finished]";
};
$queue = uv_queue_work($loop, $a, $b);
uv_run();
--EXPECT--
2015-01-18 02:58:40 +01:00
[queue][finished]