From c0b38ec57f9e2c342463bd99a10dffdde9777b6d Mon Sep 17 00:00:00 2001 From: qydysky Date: Sat, 29 Jul 2023 11:56:18 +0800 Subject: [PATCH] 2 --- msgq/Msgq_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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{ -- 2.39.2