workerman5用revoltphp报错Exception: event-loop exited
<?php
use Workerman\Worker;
use Workerman\Timer;
use Revolt\EventLoop;
require_once __DIR__ . '/vendor/autoload.php';
ini_set("memory_limit","-1");
$server = new Worker();
$server->count = 1;
$server->onWorkerStart = function ($worker){
$suspension = EventLoop::getSuspension();
var_dump(1);
Timer::add(0, function () use ($suspension) {
var_dump(2);
$suspension->resume(3);
var_dump(4);
},[],false);
var_dump(5);
echo $suspension->suspend();
var_dump(6);
};
$server->onMessage = function ($con, $msg) {
};
Exception: event-loop exited in D:\workerman5\vendor\walkor\workerman\src\Worker.php:1448
Stack trace:
#0 D:\workerman5\vendor\walkor\workerman\src\Worker.php(1367): Workerman\Worker::forkWorkersForWindows()
#1 D:\workerman5\vendor\walkor\workerman\src\Worker.php(572): Workerman\Worker::forkWorkers()
#2 D:\workerman5\start.php(30): Workerman\Worker::runAll()
#3 {main}
windows10
"revolt/event-loop": "1.0.1",
"workerman/workerman": "v5.0.0-beta.6"
你得php版本够吗?
8.2的,会不会是没有装libuv扩展的问题,windows对应版本扩展没找到
windows下 v5.0.0-beta.6 的 bug,等下个版本修复
升级到 v5.0.0-beta.7
什么是速度,这就是速度
牛的牛的