mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 13:18:01 +08:00
23 lines
306 B
Go
23 lines
306 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/gogf/gf/g"
|
|
)
|
|
|
|
func main() {
|
|
conn := g.Redis().Conn()
|
|
defer conn.Close()
|
|
_, err := conn.Do("SUBSCRIBE", "channel")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
for {
|
|
reply, err := conn.ReceiveVar()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Println(reply.Strings())
|
|
}
|
|
}
|