pub struct AutoStart;Implementations§
Source§impl AutoStart
impl AutoStart
Sourcepub fn run() -> Result<(), AppError>
pub fn run() -> Result<(), AppError>
Build a Tokio runtime, boot the application, then — when serving (REST
automation on, or any websocket service registered) or when a component
declared Platform::keep_running (a
headless app whose Kafka flow adapter consumes topics, say) — stay alive
until the process is told to stop: Ctrl-C, or SIGTERM on Unix (Java:
the JVM stays up on non-daemon threads and runs its shutdown hooks on
either). This is the whole fn main() body; the auto_start_main! macro
wraps exactly this plus the app’s resource root.
Sourcepub async fn main(args: Vec<String>) -> Result<(), AppError>
pub async fn main(args: Vec<String>) -> Result<(), AppError>
The async lifecycle (must run within a Tokio runtime): run every
before-application hook, bind the preloads, start the HTTP/websocket
server when serving — then return (the accept loop keeps running as
a background task). Booting the engine hands control back to the caller;
a standalone process uses AutoStart::run to serve until Ctrl-C or SIGTERM.
Runs only once per process (Java parity: AutoStart.started is an
AtomicBoolean) — repeated execution is a no-op.