企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# waitgroup 示例代码: ~~~php go(function (){ $ret = []; $wait = new \EasySwoole\Component\WaitGroup(); $wait->add(); go(function ()use($wait,&$ret){ \co::sleep(0.1); $ret[] = time(); $wait->done(); }); $wait->add(); go(function ()use($wait,&$ret){ \co::sleep(2); $ret[] = time(); $wait->done(); }); $wait->wait(); var_dump($ret); }); ~~~