This commit is contained in:
zhouyuyan
2017-08-22 15:25:56 +08:00
parent a51adb55b2
commit 25a9a759f7
6 changed files with 246 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
package lib
import "sync"
type MessagePool struct {
sync.Mutex
queue chan *Message
}
func (p *MessagePool) Init(len int, maxusernum int) {
p.maxuser = maxusernum
p.queue = make(chan *Message, len)
}