Skip to content

Commit bc44c4f

Browse files
Update scheduler-join.md
1 parent 716c1dc commit bc44c4f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

md/cn/scheduler-join.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# go\Scheduler::join
2+
3+
\(PHP 5 >= 5.4.0, PHP 7, phpgo >= 0.9.0\)
4+
5+
join — 运行协程调度器直到所用户协程数小于指定数量
6+
7+
## 说明
8+
#### mixed join([int $remains])
9+
10+
运行协程调度器,等待所有用户协程运行完毕后返回;若指定了remains参数,则当前用户协程数小于等于remains时返回。
11+
注意这里的“用户协程”指通过在php代码调用go/goo启动的协程;phpgo内部也可能会启动协程,这些协程不算在内。
12+
13+
## 参数
14+
15+
#### remains
16+
join()在用户协程数减小到remains时返回
17+
18+
19+
## 返回值
20+
返回TRUE。
21+
22+
## 参见
23+
- [go\Scheduler::loop](https://github.com/birdwyx/phpgo/blob/master/md/cn/scheduler-loop.md) — 运行协程调度器直到调度线程退出
24+
- [go\Scheduler::run](https://github.com/birdwyx/phpgo/blob/master/md/cn/scheduler-run.md) — 检查一遍所有协程,如果有就绪的就运行一次

0 commit comments

Comments
 (0)