Files
zhub/x_test.go
lxy 2dcfc5e9bf .
git-svn-id: svn://47.119.165.148/zhub@61 e63fbceb-bcc3-4977-ac22-735b83d8d0f4
2021-01-08 11:52:30 +00:00

33 lines
498 B
Go

package main
import (
"log"
"strconv"
"testing"
"time"
"zhub/cli"
)
func TestName(t *testing.T) {
//client, err := cli.Create("39.108.56.246:1216", "")
client, err := cli.Create("127.0.0.1:1216", "")
if err != nil {
log.Fatal(err)
}
client.Subscribe("a-1", func(v string) {
log.Println(v)
})
client.Timer("t", "* * * * * *")
go func() {
for i := 0; i < 50000; i++ {
client.Publish("a-1", strconv.Itoa(i))
time.Sleep(time.Second)
}
}()
time.Sleep(time.Hour * 3)
}