Csp 并发等待执行

最后更新于:2022-04-02 02:21:45

[TOC] ## 概述 ``` go(function (){ $csp = new \EasySwoole\Component\Csp(); $csp->add('t1',function (){ \co::sleep(0.1); return 't1 result'; }); $csp->add('t2',function (){ \co::sleep(0.1); return 't2 result'; }); var_export($csp->exec(5)); /** * array ( 't1' => 't1 result', 't2' => 't2 result', ) */ }); ```
';