]> 127.0.0.1 Git - part/.git/commitdiff
2 v0.28.0+20230729c0b38ec
authorqydysky <qydysky@foxmail.com>
Sat, 29 Jul 2023 03:56:18 +0000 (11:56 +0800)
committerqydysky <qydysky@foxmail.com>
Sat, 29 Jul 2023 03:56:18 +0000 (11:56 +0800)
msgq/Msgq_test.go

index 0fd9005af554cba8a7ebe0485d69d647f7ca217a..1cf194b2a92b2ab95f03107f1546711444e8d86a 100644 (file)
@@ -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{