mirror of
https://github.com/xxjwxc/public.git
synced 2025-09-27 12:12:13 +08:00
new
This commit is contained in:
@@ -151,6 +151,11 @@ func (q *MyQueue) Close() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsClose check is closed
|
||||||
|
func (q *MyQueue) IsClose() bool {
|
||||||
|
return q.closed
|
||||||
|
}
|
||||||
|
|
||||||
//Wait 等待队列消费完成
|
//Wait 等待队列消费完成
|
||||||
func (q *MyQueue) Wait() {
|
func (q *MyQueue) Wait() {
|
||||||
for {
|
for {
|
||||||
|
@@ -110,6 +110,7 @@ func TestTimeout(t *testing.T) {
|
|||||||
for i := 0; i < 10; i++ { //开启20个请求
|
for i := 0; i < 10; i++ { //开启20个请求
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
que.Push(i)
|
que.Push(i)
|
||||||
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user