disposeAndExit
@rotorsoft/act-root / act/src / disposeAndExit
Function: disposeAndExit()
disposeAndExit(
code?):Promise<void>
Defined in: libs/act/src/ports.ts:212
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>