WangzJi commented on code in PR #3023: URL: https://github.com/apache/dubbo-go/pull/3023#discussion_r2346302018
########## filter/accesslog/filter.go: ########## @@ -214,6 +189,68 @@ func (f *Filter) OnResponse(_ context.Context, result result.Result, _ base.Invo return result } +// start initializes and starts the background goroutine for processing logs +func (f *Filter) start() { Review Comment: @AlexStocks 感谢review,分离主要考虑一下因素: 1. 职责分离:`start()` 负责启动,`processLogs()` 负责核心逻辑,单一职责更清晰 2. 可测试性:可以独立测试 `processLogs()` 的业务逻辑,无需启动`goroutine` 3. 可读性:函数名语义明确,比单个大函数更易理解 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org