Skip to content

Commit

Permalink
Update README_zh.md with 'Dynamic Worker Adjustment' updated
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-hutao committed Sep 11, 2023
1 parent 4653dd3 commit 71c44d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ func main() {
}
```


## 动态工作器调整

GoPool 支持动态工作器调整。这意味着池中的工作器数量可以根据队列中的任务数量增加或减少。可以通过在创建池时设置 MinWorkers 选项来启用此功能。
Expand Down Expand Up @@ -230,7 +231,7 @@ func main() {
}
```

在这个示例中,池开始时有50个工作器。如果队列中的任务数量超过(MaxWorkers - MinWorkers) / 2 + MinWorkers,池将添加更多的工作器。如果队列中的任务数量少于 MinWorkers,池将移除一些工作器
在这个示例中,池开始时有50个工作器。如果队列中的任务数量超过当前工作器数量的3/4,并且当前工作器数量小于 MaxWorkers,池将翻倍工作器数量,直到达到 MaxWorkers。如果队列中的任务数量为零,并且当前工作器数量大于 MinWorkers,池将把工作器数量减半,直到达到 MinWorkers。

## 任务超时处理

Expand Down

0 comments on commit 71c44d1

Please sign in to comment.