disposeAndExit
@rotorsoft/act-root / act/src / disposeAndExit
Function: disposeAndExit()
disposeAndExit(
code?):Promise<void>
Defined in: libs/act/src/ports.ts:236
Disposes all registered adapters and disposers, then exits the process.
Execution order:
- Custom disposers (registered via dispose) โ in reverse order
- Port adapters (log, store, cache) โ in reverse registration order
- Adapter registry is cleared
- Process exits (skipped in test environment)
In production, "ERROR" exits are silently ignored to avoid crashing on
transient failures (e.g. an uncaught promise in a non-critical path).
Parametersโ
code?โ
"ERROR" | "EXIT"
Exit code: "EXIT" for clean shutdown (exit 0),
"ERROR" for abnormal termination (exit 1)
Returnsโ
Promise<void>