Skip to main content

gateway_start_hook_reporter

Function gateway_start_hook_reporter 

pub fn gateway_start_hook_reporter(
    hooks: Option<Arc<HookRunner>>,
    host: String,
    inner: Option<GatewayReadinessReporter>,
) -> Option<GatewayReadinessReporter>
Expand description

Wrap a gateway readiness reporter so the on_gateway_start hook fires when the gateway reports the address it actually bound.

The process that owns the gateway (the daemon, or the standalone zeroclaw gateway command) owns the hook, not the gateway listener. The hook fires at most once per reporter, and each gateway start gets a fresh reporter, so every start fires it exactly once even if readiness is reported again. host is the configured bind host; the port is the one the listener actually bound, which differs from the configured port when that is 0. The hook runs on its own task so a slow handler cannot delay the listener. Returns inner unchanged when hooks are disabled.