Exemple #1
0
// Run the given event though the pipeline
func (p *Pipeline) Process(e *event.Event) {
	if p.globalPolicy != nil {
		if !p.globalPolicy.CheckMatch(e) || !p.globalPolicy.CheckNotMatch(e) {
			return
		}
	}

	// track stas for this event
	p.tracker.TrackEvent(e)

	// process this event on every policy
	var pol *alarm.Policy
	for _, pol = range p.policies {
		e.WaitInc()
		pol.Process(e, func(in *event.Incident) {
			p.ProcessIncident(in)
		})
	}

}