Framework lifecycle
StartService / StopServiceGo lifecycle
Go maker initialization, graph construction, source-last startup, and context-bounded drain.
When to use
Use this page when implementing maker hooks, owning resources, or diagnosing startup and shutdown.
Behavior
initMakersfills missing defaults, thencustomMakersInitmay replace them.initFunctionsand infrastructure makers useerrgroupfor concurrent creation and sibling cancellation.ServiceApp.Startbuilds streams and starts managed connectors, storage, pools, components, Sinks, then Sources.StopServicecreates the timeout context consumed by every stop phase.
Go startup sequence
ConfigurationLoad graph configResolve typed service, stream, connector, and endpoint settings.
FactoriesinitMakersInstall defaults, then run
customMakersInit and customFunctionsInit.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.
Go 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.
- HTTP admission, components, and ordinary Sources stop first.
- Managed connector admission stops after ordinary Sources, preserving Cron-to-Temporal work.
- Nested parallel graph calls drain before pools and storage.
- Sinks stop before managed clients; telemetry stops last.
Hooks and boundaries properties
Generated extension points and runtime-owned lifecycle boundaries.
PropertyTypeDescription
initMakersgeneratedInstalls defaults only where no maker exists.
customMakersInituser hookReplaces makers before construction.
customFunctionsInituser hookAdjusts instances before stream construction.
Start(ctx)runtimeActivates downstream resources before Sources.
Stop(ctx)runtimeUses the deadline applied by StopService.
Lifecycle outline
configure -> make once -> bind -> start -> admit -> drain -> stop