异步队列新增Get方式

This commit is contained in:
boyce
2019-03-05 15:40:48 +08:00
parent 283193359d
commit c74a8a5318
2 changed files with 6 additions and 1 deletions

View File

@@ -94,3 +94,9 @@ func (q *SyncQueue) IsClose() (v bool) {
q.lock.Unlock()
return
}
func (q *SyncQueue) Get(i int) interface{} {
q.lock.Lock()
defer q.lock.Unlock()
return q.buffer.Get(i)
}