延迟无锁队列测试用例优化
This commit is contained in:
parent
39970847c6
commit
6f0dd4955d
@ -19,14 +19,15 @@ func TestDelayLkQueue(t *testing.T) {
|
|||||||
q.DelayEnqueue(c.value, c.duration)
|
q.DelayEnqueue(c.value, c.duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
notidy := make(chan int)
|
notify := make(chan int)
|
||||||
go func() {
|
go func() {
|
||||||
for data := range notidy {
|
for data := range notify {
|
||||||
t.Log(data)
|
t.Log(data)
|
||||||
t.Log(time.Now().Unix())
|
t.Log(time.Now().Unix())
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
go q.ContinuousDequeue(notidy)
|
go q.ContinuousDequeue(notify)
|
||||||
time.Sleep(time.Second * 5)
|
time.Sleep(time.Second * 5)
|
||||||
|
close(notify)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user