PUBLISH
Syntax
PUBLISH channel message
Module
pubsubCategories
pubsub fastDescription
Publish a message to the specified channel.
Examples
- Go (Embedded)
- CLI
Publish a message to the specified channel:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
ok, err := db.Publish("channel1", "Hello, world!")
Publish a message to the specified channel:
> PUBLISH channel1 "Hello, world!"