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.

RemoveAllListeners #

Removes all channels from an event.
If no eventName is specified, removes all channels from all events.

Channels removed this way are not closed.

Arguments #

Copied to clipboard!
RemoveAllListeners(event int)

Argument Type Description
event
int
Event constant from the event package

Usage #

Copied to clipboard!
ch := make(chan json.RawMessage)
kuzzle.On(event.Connected, ch)
go func() {
  for range ch {
    fmt.Println("Connected to Kuzzle")
  }
  fmt.Println("Stopped listening")
}()
kuzzle.RemoveAllListeners(event.Connected)
close(ch)