Skip to main content

worker_router_with_shutdown

Function worker_router_with_shutdown 

Source
pub fn worker_router_with_shutdown(
    worker: Worker,
    env_dir: impl Into<PathBuf>,
    work_dir: impl Into<PathBuf>,
    token: Option<String>,
) -> (Router, ShutdownSignal)
Expand description

Build a worker router together with the handle that stops it.

Callers that own the serve loop (the binary, serve_worker) pass the signal to with_graceful_shutdown so a Shutdown message ends the server the same way Ctrl+C does.