// StartListeningToEvents starts to listen to events from input channel.
// Don't call it twice!

StartListeningToEvents starts to listen to events from input channel.
Don't call it twice!
// StartListeningToEvents starts to listen to events from input channel . // Don ' t call it twice!
func (d *ChatDB) StartListeningToEvents(ch <-chan events.Event) {
	go func() {
		for {
			event := <-ch
			switch e := event.(type) {
			case *events.LogoutEvent:
				logoutUserFromAllChats(e.UserName, d)
			}
		}
	}()
}
func ( d * ChatDB ) StartListeningToEvents ( ch <- chan events . Event ) { go func ( ) { for { event := <- ch switch e := event . ( type ) { case * events . LogoutEvent : logoutUserFromAllChats ( e . UserName , d ) } } } ( ) }
StartListeningToEvents starts to listen to events from input channel.
StartListeningToEvents starts to listen to events from input channel .