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, starts managed connector cores and downstream categories, calls startAdmission before DataSources, and starts HTTP last.
  • The runner passes serviceConfig.shutdownTimeout into app.stop.

TypeScript startup sequence

TypeScript shutdown sequence

  • Stopping during startup aborts startup and waits for reverse-order rollback.
  • stopAdmission closes DataSource, Component, and HTTP admission together; resources without a separate admission API are stopped in that phase.
  • Admission-aware DataSources then drain before managed connector admission stops.
  • Storage, DelayPool, TaskPool, and PriorityTaskPool stop before RuntimeTaskRegistry.drain.
  • The registry closes task admission after the producer phase and cancels on drain failure.
  • DataSinks, managed connector cores, and telemetry then 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, managed connector cores, storage, pools, Components, Sinks, managed admission, DataSources, HTTP.

RuntimeTaskRegistrydrain boundary

Tracks nested work and closes task admission.

Lifecycle outline

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