agent/eventstream/eventstream.go
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
		}
	}
}
// listen listens to the event channel