simplemq/cmd/send/main.go

22 lines
336 B
Go
Raw Normal View History

2021-11-15 23:06:05 +00:00
package main
import (
2021-11-17 00:26:51 +00:00
"go.digitalcircle.com.br/open/simplemq/lib/smqcli"
2021-11-15 23:06:05 +00:00
"log"
"time"
)
func main() {
2021-11-17 00:26:51 +00:00
c, err := smqcli.New("ws://localhost:8080/ws")
2021-11-15 23:06:05 +00:00
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)
}
}