SAService Architect Back to designer
SAService ArchitectDocumentation
Framework lifecycle GeneratedService::new / run

Rust lifecycle

Typed maker tables, concurrent futures, immutable assembly, Tokio servers, and bounded drain.

When to use

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

Behavior

  • ServiceMakers::default is mutated by custom_makers_init before invocation.
  • Function and infrastructure maker groups run concurrently with a cancellable child context.
  • GeneratedService::new binds streams and connectors; run opens the app and waits for termination.
  • ServiceApp::stop applies shutdown_timeout and drains HTTP/gRPC before graph resources.

Rust startup sequence

Rust shutdown sequence

  • HTTP and gRPC tokens close network admission.
  • Sources and components stop concurrently.
  • drain_parallel completes nested work before pools and storage.
  • Startup failure transitions through normal stop cleanup.

Hooks and boundaries properties

Generated extension points and runtime-owned lifecycle boundaries.

PropertyTypeDescription
ServiceMakersgenerated struct

Typed Arc closures for factories.

custom_makers_inituser function

Mutates makers before async initialization.

GeneratedService::newconstruction

Builds and binds without opening admission.

ServiceApp::startactivation

Starts Sinks before Sources and servers.

ServiceApp::stopdrain

Applies service timeout and records telemetry.

Lifecycle outline

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