mirror of
https://github.com/danog/ext-uv.git
synced 2024-11-26 20:14:47 +01:00
WIP: uv_queue_work
This commit is contained in:
parent
0bc6c44146
commit
4e4f9dc0ab
@ -1,14 +1,11 @@
|
||||
<?php
|
||||
$loop = uv_default_loop();
|
||||
|
||||
$a = function(){
|
||||
var_dump("[queue]");
|
||||
};
|
||||
|
||||
$b = function(){
|
||||
$queue = uv_queue_work($loop, function(){
|
||||
echo "[queue]";
|
||||
}, function(){
|
||||
echo "[finished]";
|
||||
};
|
||||
$queue = uv_queue_work($loop, $a, $b);
|
||||
});
|
||||
|
||||
|
||||
uv_run();
|
||||
|
17
tests/800-uv_queue_work.phpt
Normal file
17
tests/800-uv_queue_work.phpt
Normal file
@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Check for uv_queue_work
|
||||
--FILE--
|
||||
<?php
|
||||
$loop = uv_default_loop();
|
||||
|
||||
$a = function(){
|
||||
echo "[queue]";
|
||||
};
|
||||
|
||||
$b = function(){
|
||||
echo "[finished]";
|
||||
};
|
||||
$queue = uv_queue_work($loop, $a, $b);
|
||||
uv_run();
|
||||
--EXPECT--
|
||||
[finished][queue]
|
Loading…
Reference in New Issue
Block a user