aceld / aceld/zinx

关闭服务时,书写重复代码

Open
#290 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
7.8k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

```ruby
func (s *Server) Stop() {
zlog.Ins().InfoF("[STOP] Zinx server , name %s", s.Name)

// Clear other connection information or other information that needs to be cleaned up
// (将其他需要清理的连接信息或者其他信息 也要一并停止或者清理)
s.ConnMgr.ClearConn()
s.exitChan <- struct{}{}
close(s.exitChan)
}
```

其实只需要close(s.exitChan),不需要在投递一个struct{}{},重复书写代码

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.