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 graph resources; the generated Beast HTTP server opens afterward.stopRuntimecloses the generated HTTP server and HTTP client objects before entering the ServiceApp graph shutdown.- ServiceApp then drains graph work while callers and streams live, stops DataSinks, and releases execution runtime ownership.
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.
BindingBuild graph and endpointsBind streams, callers, endpoint consumers, functions, and transport routes.
Connector coreOpen clientsStart managed connector clients before anything can submit or poll.
DownstreamStart graph resourcesStart storage, pools, components, and Sinks before inbound work.
Worker admissionStart managed pollingOpen Temporal or other connector-owned inbound workers after Sinks are ready.
SourcesStart DataSourcesOpen ordinary graph admission only after every downstream dependency is ready.
ServersStart listenersOpen generated HTTP and gRPC listeners after endpoint bindings and graph resources are ready.
C++ Boost shutdown sequence
SignalStop requestedCreate one deadline from
shutdownTimeout.NetworkClose listenersReject new HTTP/gRPC requests and drain accepted handlers while graph dependencies remain alive.
SourcesDrain root workStop ordinary DataSources and admission-aware components.
WorkersStop managed admissionStop connector-owned polling only after ordinary Sources have drained.
ProducersPools, timers, storageStop admission and drain tasks that can still create graph work.
GraphParallelCall registryDrain only after no producer can create another child.
OutputStop DataSinksFlush results and accepted outbound submissions.
Connector coreClose clientsRelease managed connector clients after Sources, graph work, and Sinks no longer need them.
ReleaseRelease graph ownershipDrop endpoint consumers, streams, functions, and bindings only after their callbacks cannot run.
TelemetryFlush diagnosticsMetrics, traces, and logs cover shutdown and stop at the final safe boundary.
- The generated Beast server is stopped before
ServiceApp::stop; generated HTTP sink clients are stopped in the same wrapper phase. - DataSources and Components then stop before executor resources.
- PriorityTaskPool, TaskPool, DelayPool, and Storage drain before execution counters are observed.
- Graph callbacks may emit results while draining, so runtime DataSinks stay alive through graph drain.
releaseRuntimeclears connector, endpoint, binding, stream, function, router, and server views after shutdown.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.
serviceStoppingnoexcept user hookRuns once before ServiceApp shutdown; generated code logs hook failures and continues cleanup.
stopRuntimegeneratedCoordinates server stop, drain, and release.
Lifecycle outline
configure -> make once -> bind -> start -> admit -> drain -> stop