Framework lifecycle
ServiceGenerated::start / stopRuntimeC++ Boost lifecycle
Boost.Asio coroutine makers, generated HTTP activation, graph drain, and runtime release.
When to use
Use this page when implementing maker hooks, owning resources, or diagnosing startup and shutdown.
Behavior
- Generated makers return
boost::asio::awaitableresults before graph activation. initRuntimeconstructs router, server, clients, functions, streams, and endpoint bindings.ServiceApp::startactivates resources; generated HTTP admission opens afterward.- Stop drains graph work while callers and streams live, then stops Sinks and execution runtime.
C++ Boost startup sequence
ConfigurationLoad graph configResolve typed service, stream, connector, and endpoint settings.
FactoriesinitMakersInstall defaults, then run
customMakersInit and serviceStarted.ConstructionInvoke makers onceCreate infrastructure and long-lived functions in parallel.
GraphBuild and bindConstruct streams, callers, endpoint consumers, and transports.
StartOpen admission lastStart dependencies and Sinks before Sources and servers.
C++ Boost shutdown sequence
SignalStop requestedCreate one deadline from
shutdownTimeout.AdmissionListeners and SourcesReject new root work and drain accepted calls.
GraphNested workKeep pools, storage, Sinks, and clients alive.
ResourcesPools, storage, SinksRelease graph dependencies in safe order.
TelemetryFlush and releaseMetrics, traces, and logs stop last.
- The generated HTTP server uses the service shutdown timeout.
- Graph callbacks may emit results while draining, so Sinks stay alive.
stopRuntimeandreleaseRuntimecover normal stop, rollback, and destruction.
Hooks and boundaries properties
Generated extension points and runtime-owned lifecycle boundaries.
PropertyTypeDescription
initMakersgeneratedAssigns coroutine factories.
customMakersInitvirtual hookReplaces factories before invocation.
initRuntimegeneratedAwaitably creates objects and binds graph.
http_server_->StartadmissionOpens HTTP after ServiceApp is ready.
stopRuntimegeneratedCoordinates server stop, drain, and release.
Lifecycle outline
configure -> make once -> bind -> start -> admit -> drain -> stop