master
兔子 4 years ago
parent b02c1f0a81
commit 455d1d7f78

@ -32,6 +32,8 @@ type StarQueue struct {
duration time.Duration
EncodeFunc func([]byte) []byte
DecodeFunc func([]byte) []byte
//parseMu sync.Mutex
restoreMu sync.Mutex
}
// NewQueue 建立一个新消息队列
@ -249,6 +251,8 @@ func bytesMerge(src ...[]byte) []byte {
// Restore 获取收到的信息
func (que *StarQueue) Restore(n int) ([]MsgQueue, error) {
que.restoreMu.Lock()
defer que.restoreMu.Unlock()
var res []MsgQueue
dura := time.Duration(0)
for len(que.MsgPool) < n {

Loading…
Cancel
Save