使用revoltphp报错Exception: event-loop exited

嘿嘿哈哈

问题描述

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}

操作系统及workerman/webman等框架组件具体版本

windows10
"revolt/event-loop": "1.0.1",
"workerman/workerman": "v5.0.0-beta.6"

902 2 0
2个回答

tanhongbin

你得php版本够吗?

  • 嘿嘿哈哈 2023-07-27

    8.2的,会不会是没有装libuv扩展的问题,windows对应版本扩展没找到

walkor 打赏

windows下 v5.0.0-beta.6 的 bug,等下个版本修复

年代过于久远,无法发表回答
×
🔝