Skip to main content

Module app

Module app 

Source
Expand description

Launch contract.

Boot phases (executed strictly in this order — order matters):

  1. Collect inventory-registered providers + routes.
  2. Run each plugin’s on_init with a mutable ArclyPluginContext — plugins may queue providers (provide<T>), routes, global interceptors, OpenAPI mutators.
  3. Apply queued provider closures to the DiContainerBuilder.
  4. Freeze. The container becomes &'static, lock-free for reads.
  5. Build the OpenAPI spec, run plugin spec-mutators, leak it as &'static.
  6. Mount macro-registered routes, then plugin-registered routes.
  7. Bind the listener.
  8. Run each plugin’s on_start(&container) — background tasks spawn here.
  9. Serve. Ctrl-C / SIGTERM triggers axum’s graceful shutdown — accepts stop, in-flight drain. Only after that completes do plugin on_shutdown(&container) calls run, each wrapped in a 5-second per-plugin timeout so a wedged plugin can never wedge the process.

Structs§

App
LaunchConfig
Tunables for the launch contract. Start from Default and adjust: