()
| 158 | static EVENT_HANDLER: OnceLock<EventHandler<AtomicContextManager>> = OnceLock::new(); |
| 159 | |
| 160 | pub async fn event_handler() -> &'static EventHandler<AtomicContextManager> { |
| 161 | let eh = match EVENT_HANDLER.get() { |
| 162 | None => { |
| 163 | let event_handler = init_event_handler().await; |
| 164 | |
| 165 | EVENT_HANDLER.get_or_init(|| event_handler) |
| 166 | } |
| 167 | Some(event_handler) => event_handler, |
| 168 | }; |
| 169 | eh |
| 170 | } |
| 171 | |
| 172 | static POOL: OnceLock<PgPool> = OnceLock::new(); |
| 173 |