mirror of
https://gitee.com/johng/gf.git
synced 2024-12-05 05:37:55 +08:00
24 lines
343 B
Go
24 lines
343 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/gogf/gf/g"
|
|
"github.com/gogf/gf/g/util/gconv"
|
|
)
|
|
|
|
func main() {
|
|
conn := g.Redis().Conn()
|
|
defer conn.Close()
|
|
_, err := conn.Do("SUBSCRIBE", "channel")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
for {
|
|
reply, err := conn.Receive()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Println(gconv.Strings(reply))
|
|
}
|
|
}
|