simplemq/cmd/send/main.go

22 lines
307 B
Go
Raw Normal View History

2021-11-15 23:06:05 +00:00
package main
import (
"log"
"simplemq/lib/client"
"time"
)
func main() {
c, err := client.New("ws://localhost:8080/ws")
if err != nil {
panic(err.Error())
}
for {
err = c.Pub("a", []byte("A:"+time.Now().String()))
if err != nil {
log.Printf(err.Error())
}
time.Sleep(time.Second)
}
}