reactive_graph_lifecycle/lifecycle.rs
1/// Dual layer runtime lifecycle for initialization and shutdown of services
2use async_trait::async_trait;
3
4#[async_trait]
5pub trait Lifecycle: Sync {
6 /// Called at initialization
7 async fn init(&self) {}
8
9 /// Called after initialization
10 async fn post_init(&self) {}
11
12 /// Called before shutdown
13 async fn pre_shutdown(&self) {}
14
15 /// Called for shutdown
16 async fn shutdown(&self) {}
17}