This commit is contained in:
2023-12-12 14:10:09 +08:00
parent 10f24b60d6
commit 827fb257ab
3 changed files with 2 additions and 27 deletions
-13
View File
@@ -1,14 +1 @@
<?php
use function Swoole\Coroutine\run;
run(function () {
$channel = new \Swoole\Coroutine\Channel(100);
for ($i = 0; $i < 90; $i++) {
$channel->push(100);
}
$channel->close();
$channel = null;
var_dump($channel);
});
+1 -1
View File
@@ -50,7 +50,7 @@
}
function connect() {
sock = new WebSocket('ws://127.0.0.1:9528/222');
sock = new WebSocket('wss://center-wss.stupideyes.com/ws?access_token=6648f48a-466ba-6394-70527ef8b-bc47b8');
sock.onopen = function () {
if (tick) {
clearInterval(tick)
+1 -13
View File
@@ -1,13 +1 @@
<?php
$i = 0;
while ($i <= 100) {
for ($ii = 0; $ii < 10; $ii++) {
echo "\r";
$i++;
echo '[' . $i . '%]' . "\r";
}
sleep(1);
}
<?php