Skip to content

Commit

Permalink
doc: update some doc for async fire events
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Jun 10, 2023
1 parent 9f32831 commit 84c8399
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ em := event.NewManager("test", event.UsePathMode)

### Use `chan` fire events

You can use the `Async/FireC/FireAsync` method to trigger events, and the events will be written to chan for asynchronous consumption.
You can use `CloseWait()` to close the chan and wait for all events to be consumed.

Added option configuration:

- `ChannelSize` Set buffer size for `chan`
Expand Down
4 changes: 3 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ em := event.NewManager("test", event.UsePathMode)

### 使用 `chan` 消费事件

可以通过配置选项:
可以使用 `Async/FireC/FireAsync` 方法触发事件,事件将会写入 chan 异步消费。可以使用 `CloseWait()` 关闭chan并等待事件全部消费完成。

**新增配置选项**:

- `ChannelSize` 设置 `chan` 的缓冲大小
- `ConsumerNum` 设置启动多少个协程来消费事件
Expand Down

0 comments on commit 84c8399

Please sign in to comment.