Ejemplo n.º 1
0
func dispatch(trigger string) (string, error) {
	scheduler, err := scheduler.NewScheduler()
	if err != nil {
		return "Failed to create scheduler", err
	}
	if err := scheduler.Dispatch(trigger); err != nil {
		return fmt.Sprintf("Failed to dispatch event(%s)", trigger), err
	}
	return "", nil
}
Ejemplo n.º 2
0
func agent() (string, error) {
	time.Sleep(5 * time.Second)
	scheduler, err := scheduler.NewScheduler()
	if err != nil {
		return "Failed to create scheduler", err
	}
	go scheduler.Run()

	return waitSignal()
}