Source Events ↗

daemon.starting

Daemon is about to start HTTP.

When
After config mutation and final config apply, before the router is served.
Payload
Empty.
Cancelable
No

Use for startup initialization that needs the final daemon config.

Use cases

  • Warm plugin caches
  • Open external connections

Example

Registration and handler

Register

hook!(host, PluginEvent::DaemonStarting, on_daemon_starting);

Handler

extern "C" fn on_event(ctx: *const EventContext) -> HookResult {
    let ctx = unsafe { &*ctx };
    let payload = unsafe { std::slice::from_raw_parts(ctx.payload_ptr, ctx.payload_len) };
    let _json = std::str::from_utf8(payload).unwrap_or_default();
    HookResult::r#continue()
}

← All lifecycle events