新增:zconn.appendTo 方法,调整代码风格

git-svn-id: svn://47.119.165.148/zhub@65 e63fbceb-bcc3-4977-ac22-735b83d8d0f4
This commit is contained in:
lxy
2021-01-10 18:02:12 +00:00
parent 01ced95223
commit 320a94af2d
4 changed files with 51 additions and 52 deletions

View File

@@ -2,14 +2,15 @@ package main
import (
"log"
"strconv"
"testing"
"time"
"zhub/cli"
)
func TestCli(t *testing.T) {
//client, err := cli.Create("39.108.56.246:1216", "")
client, err := cli.Create("127.0.0.1:1216", "topic-x")
client, err := cli.Create("39.108.56.246:7070", "")
//client, err := cli.Create("127.0.0.1:1216", "topic-x")
if err != nil {
log.Fatal(err)
}
@@ -24,12 +25,12 @@ func TestCli(t *testing.T) {
log.Println("收到 t------------------x 定时消息")
})
/*go func() {
go func() {
for i := 0; i < 100000; i++ {
client.Publish("a", strconv.Itoa(i))
time.Sleep(time.Second)
}
}()*/
}()
client.Subscribe("a", func(v string) {
log.Println("收到主题 a 消息 " + v)