pubsub := rdb.Subscribe(ctx, "mychannel1")
// Close the subscription when we are done.
defer pubsub.Close()
// vs unsubscribe from a channel
defer pubsub.Unsubscribe(ctx, "mychannel1")
ch := pubsub.Channel()
for msg := range ch {
fmt.Println(msg.Channel, msg.Payload)
}
If I don't wan't redis pub-sub channel anymore. Which is the recommended way to unsubscribe a receiver/subscription from a channel and why? Do I also need to delete the redis pub-sub channel at the end too?