1
0
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:
Vladimir Mihailenco
2015-07-11 13:42:44 +03:00
parent 2cb6b30541
commit d7edae84cf
3 changed files with 72 additions and 41 deletions

View File

@ -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 {