Module type Tick.LIFECYCLE

module type LIFECYCLE = sig .. end
The type for program life cycle events.

LIFECYCLE provides the ability to watch important events occuring in the life time of the program.



Events


type 'a event 
The type for life cycle events with payloads of type 'a.
type watcher 
The type for event watchers.
val watch : 'a event -> ('a -> unit) -> watcher
watch e f is a key-value watcher such that f is called whenever event e occurs.
val unwatch : watcher -> unit
unwatch w stops the watcher w. After that call it's callback is guaranteed not to be called again.
val poweron : unit event
poweron occurs shortly after the system powers up.
val poweroff : unit event
poweroff occurs shortly before the system is going to power off.
val suspend : unit event
suspend occurs shortly before the system is suspended.
val resume : unit event
resume occurs shortly after the system resumes after having been Tick.LIFECYCLE.suspended.