Closed qqqqbbbb closed 2 years ago
您好,请问启用协程的思路是怎样的呢
需要处理好全局变量
成本低方案,构造全局Map,key为协程ID,value为全局变量
协程ID
value
$globalContainer = [ '1' => [ 'db' => 'xxx', 'user' => 'xxx' ] ];
成本高方案,全局变量只作为池,每个协程单独从池中获取资源,该资源协程间不共享
池
您好,请问启用协程的思路是怎样的呢