SDK
SDK Golang v1.x
1

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