You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
12
vendor/swoole/examples/async/write.php
vendored
Executable file
12
vendor/swoole/examples/async/write.php
vendored
Executable file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
function write_callback($file, $writen)
|
||||
{
|
||||
echo "write $file [$writen]\n";
|
||||
//return true: write contine. return false: close the file.
|
||||
return true;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 10; $i++)
|
||||
{
|
||||
swoole_async_write("data.txt", str_repeat('A', 10) . "\n", -1, "write_callback");
|
||||
}
|
Reference in New Issue
Block a user