optimize channel orchestration with errgroup and rate limiter

This commit is contained in:
DBT
2026-02-24 09:34:13 +00:00
parent 4105eeb0db
commit 8f75bb9ed8
4 changed files with 67 additions and 38 deletions

View File

@@ -21,11 +21,13 @@
1. **Actor 化关键路径process**
- process 元数据持久化改为异步队列(`persistQ`)串行落盘。
- channel 启停编排使用 `errgroup.WithContext` 并发+统一取消。
2. **Typed Events 事件总线**
- 新增 `pkg/events/typed_bus.go` 泛型事件总线。
- process 生命周期事件start/exit/kill可发布订阅。
3. **日志批量刷盘**
- process 日志由 `logWriter` 批量 flush时间片 + 大小阈值),减少高频 I/O。
- outbound 分发增加 `rate.Limiter`(令牌桶)平滑突发流量。
4. **Context 分层取消传播**
- 后台进程改为 `exec.CommandContext`,通过父 `ctx` 统一取消。
5. **原子配置快照**