Skip to main content

PUNSUBSCRIBE

Syntax​

PUNSUBSCRIBE [pattern [pattern ...]]

Module​

pubsub

Categories​

pubsub connection slow

Description​

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​

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")