From: qydysky Date: Sat, 29 Jul 2023 03:56:18 +0000 (+0800) Subject: 2 X-Git-Tag: v0.28.0+20230729c0b38ec X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=c0b38ec57f9e2c342463bd99a10dffdde9777b6d;p=part%2F.git 2 --- diff --git a/msgq/Msgq_test.go b/msgq/Msgq_test.go index 0fd9005..1cf194b 100644 --- a/msgq/Msgq_test.go +++ b/msgq/Msgq_test.go @@ -165,6 +165,21 @@ func Benchmark_1(b *testing.B) { } } +func Test_1(t *testing.T) { + mq := New(time.Millisecond*5, time.Millisecond*10) + go mq.Push_tag(`del`, nil) + mq.Pull_tag(FuncMap{ + `del`: func(a any) (disable bool) { + mq.Push_tag(`del1`, nil) + return false + }, + `del1`: func(a any) (disable bool) { + return true + }, + }) + time.Sleep(time.Millisecond * 500) +} + func Test_RemoveInPush(t *testing.T) { mq := New(time.Second, time.Second*3) mq.Pull_tag(FuncMap{