From 4244acad88afc44ae8a34a8fbd9e296780a0cc64 Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期二, 16 五月 2023 16:00:36 +0800 Subject: [PATCH] remove github.com nsq depend --- TST/test/test.go | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/TST/test/test.go b/TST/test/test.go index 62d1fae..81e9305 100644 --- a/TST/test/test.go +++ b/TST/test/test.go @@ -6,8 +6,6 @@ "log" "nsqCli/nsqclient" "time" - - "github.com/nsqio/go-nsq" ) func produce(two bool) { @@ -49,14 +47,14 @@ ch := make(chan struct{}) count := 0 - c.AddHandler(nsq.HandlerFunc(func(msg *nsq.Message) error { + c.AddHandler(func(data []byte) error { count++ - fmt.Println("recv msg ", string(msg.Body), " size", count) + fmt.Println("recv msg ", string(data), " size", count) if count > 999000 { ch <- struct{}{} } return nil - })) + }) // go c.Run("192.168.20.108:4150", 2) go c.RunLookupd("192.168.20.108:4161", 2) @@ -69,8 +67,8 @@ } func Test() { - go produce(false) + go produce(true) - // go consume("test2", "sensor01") + go consume("test2", "sensor01") consume("test", "sensor01") } -- Gitblit v1.8.0