Framework lifecycle
Created -> Running -> StoppedLifecycle overview
The complete path from generated configuration to safe graph shutdown.
When to use
Use this page when implementing maker hooks, owning resources, or diagnosing startup and shutdown.
Behavior
- Construction and activation are separate: makers create objects, graph binding connects them, and
startopens runtime resources. - Downstream resources and Sinks start before Sources because a Source may emit immediately from
start. - Shutdown closes admission before graph drain, preserving every dependency accepted work may still call.
- Telemetry stops last so shutdown failures and timeout events remain visible.
Startup phases
No endpoint accepts work until construction and binding complete.
ConfigurationLoad graph configResolve typed service, stream, connector, and endpoint settings.
FactoriesDefault makersInstall defaults, then run custom maker and function hooks.
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.
Running phase
Makers do not run per message. Endpoint consumers repeatedly invoke the long-lived function instances created at startup.
- A function maker normally runs once per generated function or endpoint instance.
- Per-request state belongs in request hooks, not unsynchronized shared maker state.
- Connectors own listeners, clients, workers, and scheduler loops.
Graceful shutdown phases
Work accepted before the stop signal retains its dependencies until a safe completion boundary.
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.
Hooks and boundaries properties
Generated extension points and runtime-owned lifecycle boundaries.
PropertyTypeDescription
shutdownTimeoutmillisecondsTotal graceful-shutdown window shared by all phases.
workerStopTimeoutmillisecondsTemporal worker drain cap; zero inherits the service timeout.
Source admissionboundaryStops before graph pools, storage, and Sinks.
Telemetryfinal boundaryStops after runtime resources.
Lifecycle outline
configure -> make once -> bind -> start -> admit -> drain -> stop