UNSUBSCRIBE
Syntax
UNSUBSCRIBE [channel [channel ...]]
Module
pubsubCategories
pubsub connection slowDescription
Unsubscribe from a list of channels. If the channel list is not provided, then the connection will be unsubscribed from all the channels that it's currently subscribed to.
Examples
- Go (Embedded)
- CLI
Unsubscribe from all channels:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
db.Unsubscribe()
Unsubscribe from specific channels:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
db.Unsubscribe("channel1", "channel2")
Unsubscribe from all channels:
> UNSUBSCRIBE
Unsubscribe from specific channels:
> UNSUBSCRIBE channel1 channel2