mirror of
https://github.com/redis/go-redis.git
synced 2025-06-12 14:21:52 +03:00
pubsub: improve API and docs.
This commit is contained in:
@ -165,13 +165,11 @@ func ExampleMulti() {
|
||||
}
|
||||
|
||||
func ExamplePubSub() {
|
||||
pubsub := client.PubSub()
|
||||
defer pubsub.Close()
|
||||
|
||||
err := pubsub.Subscribe("mychannel")
|
||||
pubsub, err := client.Subscribe("mychannel")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer pubsub.Close()
|
||||
|
||||
err = client.Publish("mychannel", "hello").Err()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user