SDK
SDK Golang v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

Unsubscribe #

Removes a subscription.

Arguments #

Copied to clipboard!
func (r *Realtime) Unsubscribe(roomID string, options types.QueryOptions) error

Arguments Type Description
roomId
string
Subscription room ID
options
types.QueryOptions
Query options

options #

Additional query options

Option Type
(default)
Description
queuable
bool

(true)
Make this request queuable or not

Return #

Return an error is something was wrong.

Usage #

Copied to clipboard!
filters := json.RawMessage(`{}`)
listener := make(chan types.NotificationResult)
go func() {
  <-listener
}()
res, err := kuzzle.Realtime.Subscribe(
  "nyc-open-data",
  "yellow-taxi",
  filters,
  listener,
  nil)
if err != nil {
  log.Fatal(err)
}
err = kuzzle.Realtime.Unsubscribe(res.Room, nil)
if err != nil {
  log.Fatal(err)
} else {
  fmt.Println("Success")
}