Exemplo n.º 1
0
// AddMultiCheck schedule a new multi check to be executed with the given period
// the muli check can return an array of events/results
func (ce *CheckEngine) AddMultiCheck(check MultiCheckFunction, period time.Duration) {
	scheduledtask.NewScheduledTask(func() {
		for _, result := range check() {
			ce.results <- result
		}
	}, period, 0)
}
Exemplo n.º 2
0
// AddCheck schedule a new check to be executed with the given period
func (ce *CheckEngine) AddCheck(check CheckFunction, period time.Duration) {
	scheduledtask.NewScheduledTask(func() {
		ce.results <- check()
	}, period, 0)
}