RemoveListener

Removes a channel from an event.

Arguments

Copied to clipboard!
RemoveListener(event int, channel chan<- interface{})

Argument Type Description
event
int
Event constant from the event package
channel
channel
Channel to unregister

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.RemoveListener(event.Connected, ch)
close(ch)