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 #
RemoveAllListeners(event int)
Argument | Type | Description |
---|---|---|
event | int | Event constant from the event package |
Usage #
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)
Edit this page on Github(opens new window)