module type LIFECYCLE =sig
..end
LIFECYCLE
provides the ability to watch important events
occuring in the life time of the program.
type 'a
event
'a
.type
watcher
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