Runtime Lifecycle
An APPNETOS execution combines an entry point, application and context selection, initialization, and the work performed by the selected context. The exact path differs between HTTP requests, command-line operations, and long-running background processes.
One runtime, different execution paths
APPNETOS supports multiple ways to enter its runtime. A browser request, an API request, a command, and a background worker do not necessarily follow an identical path. They share architectural foundations, but their request models, security requirements, initialization needs, and completion behavior differ.
Conceptual execution stages
| Stage | Architectural responsibility |
|---|---|
| 1. Entry point | Receive an HTTP request or begin a CLI / background execution. |
| 2. Application and context selection | Determine which application and execution context are responsible for the operation. |
| 3. Runtime initialization | Load the required Shared Core services, configuration, and relevant bootstrap components. |
| 4. Context preparation | Establish the selected context and its application-specific dependencies and rules. |
| 5. Execution | Handle the request, command, scheduled job, or queued task. |
| 6. Completion | Produce a response, persist results, or finalize the current unit of work. |
These stages describe responsibilities, not a verified one-to-one call sequence. In the implementation, configuration loading, bootstrap resolution, and application selection may interleave. The precise order belongs in the detailed Bootstrap reference and must be established from the corresponding source code.
HTTP request lifecycle
For a web-facing context, the entry point accepts an HTTP request, the runtime determines the responsible application and context, and the selected context processes the operation. Depending on its role, the result may be a rendered page, a redirect, an error response, or structured API data.
Routing, URI resolution, rendering, and authentication are context-dependent capabilities. Not every HTTP-based application requires the same document model or rendering pipeline.
CLI and background lifecycle
CLI commands and background processes use execution paths appropriate to non-interactive work. A worker may run multiple tasks within a longer-lived process, whereas an HTTP request normally produces a response for a single incoming operation.
Schedulers and queue runners can coordinate background jobs, but their reservation, execution, completion, and maintenance semantics are covered in the Background Processing and Worker documentation.
Bootstrap and customization
Bootstrap configuration determines which initialization components participate in the runtime. Class mapping and application-specific extensions can affect how implementations are resolved and initialized.
The runtime lifecycle explains where these mechanisms fit architecturally; the Bootstrap & Configuration section will explain how individual bootstrap components are configured and executed.
Operational considerations
- Security: each context must enforce the access controls appropriate to its execution path.
- Resources: database and cache connections may be shared or application-specific.
- Observability: logging and debugging help trace initialization and execution failures.
- Process lifetime: long-running workers require lifecycle management different from short-lived requests.