Skip to content

Commit

Permalink
doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
chaz6chez committed Oct 12, 2024
1 parent 6936dcb commit b419063
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ composer require workbunny/webman-coroutine
|-- Coroutine # 协程 驱动
|-- WaitGroup # wait group 驱动
|-- Worker # worker 驱动
|-- Pool # 对象池 驱动
|-- RegisterMethods.php # 驱动注册助手
|-- Factory # 入口类
|-- CoroutineWebServer.php # webman 自定义http服务
|-- helpers.php # 入口助手
```

Expand Down
6 changes: 4 additions & 2 deletions docs/doc/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
// 协程1
$waitGroup->add();
$coroutine1 = new Coroutine(function () use ($waitGroup) {
// do something
echo 1 . PHP_EOL;
$waitGroup->done();
});

// 协程2
$waitGroup->add();
$coroutine2 = new Coroutine(function () use ($waitGroup) {
// do something
echo 2 . PHP_EOL;
$waitGroup->done();
});
Expand All @@ -44,7 +46,7 @@
echo 'done' . PHP_EOL;
```
> Tips:
> - 协程环境不会顺序输出1、2,但最后会输出`done`
> - 协程环境不一定会顺序输出1、2,但最后会输出`done`
> - 非协程环境会顺序输出1、2,最后输出`done`
- 协程通道的使用
Expand Down Expand Up @@ -79,7 +81,7 @@
echo 'done' . PHP_EOL;
```
> Tips:
> - 协程环境不会顺序拿到`data 1``data 2`,但最后会输出`done`
> - 协程环境不一定会顺序拿到`data 1``data 2`,但最后会输出`done`
> - 非协程环境会顺序拿到`data 1``data 2`,最后输出`done`
### 自定义`Worker`
Expand Down

0 comments on commit b419063

Please sign in to comment.