TST/test/test.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
main.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
nsqcli/LICENSE | 补丁 | 查看 | 原始文档 | blame | 历史 | |
nsqcli/README.md | 补丁 | 查看 | 原始文档 | blame | 历史 | |
nsqcli/channel.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
nsqcli/conn.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
nsqcli/consumer.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
nsqcli/pointer.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
nsqcli/pool.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
nsqcli/producer.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
nsqclient/channel_test.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
TST/test/test.go
@@ -4,16 +4,16 @@ "context" "fmt" "log" "nsqclient/nsqclient" "nsqclient/nsqcli" "time" ) func produce(two bool) { p, _ := nsqclient.NewProducer("192.168.20.108:4150") p, _ := nsqcli.NewProducer("192.168.20.108:4150") var str string for len(str) < 32 { str += "cnsqclient dynamic library" str += "cnsqcli dynamic library" } msgx := []byte(str + "--x") msgy := []byte(str + "--y") @@ -40,7 +40,7 @@ func consume(topic, channel string) { ctx, cancel := context.WithCancel(context.Background()) if c, e := nsqclient.NewNsqConsumer(ctx, topic, channel); e != nil { if c, e := nsqcli.NewNsqConsumer(ctx, topic, channel); e != nil { fmt.Println("NewNsqConsumer failed", e) return } else { main.go
@@ -6,7 +6,7 @@ import ( "nsqclient/TST/test" "nsqclient/nsqclient" "nsqclient/nsqcli" "sync" "time" "unsafe" @@ -14,18 +14,18 @@ //export createProducer func createProducer(addr string) unsafe.Pointer { n, _ := nsqclient.NewProducer(addr) return nsqclient.Save(n) n, _ := nsqcli.NewProducer(addr) return nsqcli.Save(n) } //export destroyProducer func destroyProducer(ph unsafe.Pointer) { nsqclient.Unref(ph) nsqclient.DestroyProducerPool() nsqcli.Unref(ph) nsqcli.DestroyProducerPool() } func pcvt(ph unsafe.Pointer) nsqclient.Producer { return nsqclient.Restore(ph).(nsqclient.Producer) func pcvt(ph unsafe.Pointer) nsqcli.Producer { return nsqcli.Restore(ph).(nsqcli.Producer) } //export publish @@ -58,30 +58,30 @@ ///////////////////////////////////////////////////////////// type consumer struct { nsqcon *nsqclient.NsqConsumer nsqcon *nsqcli.NsqConsumer lck sync.Mutex msgs [][]byte } //export createConsumer func createConsumer(topic, channel string) unsafe.Pointer { if c, err := nsqclient.NewNsqConsumer(nil, topic, channel); err == nil { if c, err := nsqcli.NewNsqConsumer(nil, topic, channel); err == nil { con := &consumer{ nsqcon: c, } return nsqclient.Save(con) return nsqcli.Save(con) } return nil } func ccvt(ch unsafe.Pointer) *consumer { return nsqclient.Restore(ch).(*consumer) return nsqcli.Restore(ch).(*consumer) } //export destroyConsumer func destroyConsumer(ch unsafe.Pointer) { nsqclient.DestroyNsqConsumer(ccvt(ch).nsqcon) nsqclient.Unref(ch) nsqcli.DestroyNsqConsumer(ccvt(ch).nsqcon) nsqcli.Unref(ch) } //export Run nsqcli/LICENSE
nsqcli/README.md
nsqcli/channel.go
File was renamed from nsqclient/channel.go @@ -1,4 +1,4 @@ package nsqclient package nsqcli import ( "errors" nsqcli/conn.go
File was renamed from nsqclient/conn.go @@ -1,4 +1,4 @@ package nsqclient package nsqcli import ( "sync" nsqcli/consumer.go
File was renamed from nsqclient/consumer.go @@ -1,4 +1,4 @@ package nsqclient package nsqcli import ( "context" nsqcli/pointer.go
File was renamed from nsqclient/pointer.go @@ -1,4 +1,4 @@ package nsqclient package nsqcli // #include <stdlib.h> import "C" nsqcli/pool.go
File was renamed from nsqclient/pool.go @@ -1,5 +1,5 @@ // Package pool implements a pool of net.Conn interfaces to manage and reuse them. package nsqclient package nsqcli import "errors" nsqcli/producer.go
File was renamed from nsqclient/producer.go @@ -1,4 +1,4 @@ package nsqclient package nsqcli import ( "fmt" nsqclient/channel_test.go
File was deleted