refactor: extract startup shutdown lifecycle boundary (#3634)

This commit is contained in:
安正超
2026-06-20 01:15:39 +08:00
committed by GitHub
parent eec1792cd2
commit e9037f9eb0
6 changed files with 276 additions and 206 deletions
+8
View File
@@ -31,6 +31,14 @@ Disallowed responsibilities:
- Hide globals behind a service-locator API.
- Change startup side effects while moving code.
## Shutdown Lifecycle Boundary
`startup_shutdown` owns the main shutdown sequence after the process receives a
shutdown signal. Startup modules may pass handles into this boundary, but they
must not reorder runtime-token cancellation, background service shutdown,
optional runtime shutdown planning, notifier/audit/profiling shutdown, HTTP
shutdown, optional runtime waits, or final service-state publication.
## Optional Runtime Boundary
`startup_optional_runtimes` owns startup and shutdown handoff for optional