foreach (range(1, 50) as $key => $v) {
go(function () use ($key) {
$sleep_time = random_int(1, 3);
co::sleep($sleep_time);
echo $key."睡眠了" . $sleep_time . "秒\n";
},$key);
}
swoole 协程传参
最新推荐文章于 2023-06-28 10:16:20 发布