Skip to main content

UNSUBSCRIBE

Syntax

UNSUBSCRIBE [channel [channel ...]]

Module

pubsub

Categories

pubsub connection slow

Description

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

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