SAService Architect Back to designer
SAService ArchitectDocumentation
Framework lifecycle ServiceGenerated.run / ServiceRuntime

TypeScript lifecycle

Promise makers, runtime component categories, startup rollback, task admission, and bounded stop.

When to use

Use this page when implementing maker hooks, owning resources, or diagnosing startup and shutdown.

Behavior

  • Default maker objects exist before customMakersInit.
  • initInfrastructure and initFunctionsParallel create long-lived instances before bindings.
  • ServiceRuntime validates topology and starts categories ending with Sources and HTTP.
  • The runner passes serviceConfig.shutdownTimeout into app.stop.

TypeScript startup sequence

TypeScript shutdown sequence

  • Stopping during startup aborts startup and waits for rollback.
  • Admission-aware components receive stopAdmission.
  • RuntimeTaskRegistry rejects new work and drains nested tasks.
  • Pools/storage, Sinks, connectors, and telemetry stop in ordered groups.

Startup rollback

On component start failure, already-started components stop in reverse order with startup cancellation removed. The original startup error is preserved.

Hooks and boundaries properties

Generated extension points and runtime-owned lifecycle boundaries.

PropertyTypeDescription
customMakersInituser hook

Replaces maker fields before invocation.

initFunctionsParallelgenerated

Runs independent makers as Promises.

ServiceRuntime.registerconstruction

Registers lifecycle objects only before start.

START_ORDERruntime contract

Telemetry, connectors, storage, pools, components, Sinks, Sources, HTTP.

RuntimeTaskRegistrydrain boundary

Tracks nested work and closes task admission.

Lifecycle outline

configure -> make once -> bind -> start -> admit -> drain -> stop