Init Repo

This commit is contained in:
root
2019-09-06 23:53:10 +08:00
commit f0ef89dfbb
7905 changed files with 914138 additions and 0 deletions

20
vendor/swoole/examples/coroutine/fgets.php vendored Executable file
View File

@ -0,0 +1,20 @@
<?Php
$fp = fopen(__DIR__ . "/defer_client.php", "r");
stream_set_chunk_size($fp, 1024);
go(function () use ($fp)
{
for($i = 0; $i<100;$i++) {
$r = co::fgets($fp);
if (empty($r) and feof($fp))
{
//echo "EOF\n";
break;
}
//echo "len=".strlen($r)."\n";
echo $r;
//echo "---------------------------------------\n";
//var_dump($r);
//co::sleep(1);
}
});