SAService Architect Back to designer
SAService ArchitectDocumentation
Framework lifecycle ServiceGenerated::start / stopRuntime

C++ Boost lifecycle

Boost.Asio coroutine makers, generated HTTP activation, graph drain, and runtime release.

When to use

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

Behavior

  • Generated makers return boost::asio::awaitable results before graph activation.
  • initRuntime constructs router, server, clients, functions, streams, and endpoint bindings.
  • ServiceApp::start activates graph resources; the generated Beast HTTP server opens afterward.
  • stopRuntime closes the generated HTTP server and HTTP client objects before entering the ServiceApp graph shutdown.
  • ServiceApp then drains graph work while callers and streams live, stops DataSinks, and releases execution runtime ownership.

C++ Boost startup sequence

C++ Boost shutdown sequence

  • The generated Beast server is stopped before ServiceApp::stop; generated HTTP sink clients are stopped in the same wrapper phase.
  • DataSources and Components then stop before executor resources.
  • PriorityTaskPool, TaskPool, DelayPool, and Storage drain before execution counters are observed.
  • Graph callbacks may emit results while draining, so runtime DataSinks stay alive through graph drain.
  • releaseRuntime clears connector, endpoint, binding, stream, function, router, and server views after shutdown.
  • stopRuntime and releaseRuntime cover normal stop, rollback, and destruction.

Hooks and boundaries properties

Generated extension points and runtime-owned lifecycle boundaries.

PropertyTypeDescription
initMakersgenerated

Assigns coroutine factories.

customMakersInitvirtual hook

Replaces factories before invocation.

initRuntimegenerated

Awaitably creates objects and binds graph.

http_server_->Startadmission

Opens HTTP after ServiceApp is ready.

serviceStoppingnoexcept user hook

Runs once before ServiceApp shutdown; generated code logs hook failures and continues cleanup.

stopRuntimegenerated

Coordinates server stop, drain, and release.

Lifecycle outline

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