aboutsummaryrefslogblamecommitdiff
path: root/events.go
blob: d435e62b18848eb4564b2ac0ecabbd323e4e7e2e (plain) (tree)





















                                                    
//go:generate stringer -type=Event
package rutina

// Event represents lifecycle events
type Event int

const (
	EventRoutineStart Event = iota
	EventRoutineStop
	EventRoutineComplete
	EventRoutineFail
	EventAppStop
	EventAppComplete
	EventAppFail
)

// Hook is function that calls when event fired
// Params:
// ev Event - fired event
// r *Rutina - pointer to rutina
// rid int - ID of routine if present, 0 - otherwise
type Hook func(ev Event, r *Rutina, rid int) error