func (eventStream *EventStream) listen() {
	seelog.Infof("Event stream %s start listening...", eventStream.name)
	for {
		select {
		case event := <-eventStream.event:
			eventStream.broadcast(event)
		case <-eventStream.ctx.Done():
			seelog.Infof("Event stream %s stopped listening...", eventStream.name)

			eventStream.statusLock.Lock()
			eventStream.open = false
			close(eventStream.event)
			eventStream.statusLock.Unlock()
			return
		}
	}
}
func (eventStream *EventStream) listen() {
	seelog.Infof("Event stream %s start listening...", eventStream.name)
	for {
		select {
		case event := <-eventStream.event:
			eventStream.broadcast(event)
		case <-eventStream.ctx.Done():
			seelog.Infof("Event stream %s stopped listening...", eventStream.name)

			eventStream.statusLock.Lock()
			eventStream.open = false
			close(eventStream.event)
			eventStream.statusLock.Unlock()
			return
		}
	}
}
func ( eventStream * EventStream ) listen ( ) { seelog . Infof ( " " , eventStream . name ) for { select { case event := <- eventStream . event : eventStream . broadcast ( event ) case <- eventStream . ctx . Done ( ) : seelog . Infof ( " " , eventStream . name ) eventStream . statusLock . Lock ( ) eventStream . open = false close ( eventStream . event ) eventStream . statusLock . Unlock ( ) return } } }
// listen listens to the event channel
listen listens to the event channel