This commit is contained in:
2023-08-28 12:01:30 +08:00
parent 4a607a5687
commit 9b4f5d59dc
7 changed files with 234 additions and 192 deletions
+10 -13
View File
@@ -1,17 +1,14 @@
<?php
use function Swoole\Coroutine\run;
use Swoole\Runtime;
use Swoole\Coroutine\Http\Server;
run(function () {
Runtime::enableCoroutine(true);
\Co\run(function () {
Swoole\Coroutine::create(function () {
var_dump(1);
});
$server = new Server('0.0.0.0',9501);
$server->handle('/', function () {
});
$server->start();
});
$channel = new \Swoole\Coroutine\Channel(100);
for ($i = 0; $i < 90; $i++) {
$channel->push(100);
}
$channel->close();
$channel = null;
var_dump($channel);
});