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