This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
JISQueueing/clientServer/main.go

32 lines
432 B
Go

package main
import (
"github.com/go-redis/redis/v7"
)
func main() {
client := redis.NewClient(&redis.Options{
Addr: "10.1.3.100:6379",
Password: "",
DB: 0,
})
_, err := client.Ping().Result()
if err != nil {
panic(err)
}
channel := client.Subscribe("qq")
_, err = channel.Receive()
if err != nil {
panic(err)
}
for msg := range channel.Channel() {
if msg.Channel != "qq" {
return
}
}
}