type LifecycleEventHandler = fn(&str, LifecycleEvent) -> Result<()>;
Lifecycle event handler callback