Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
runtime_bootstrap.hpp
Go to the documentation of this file.
1#pragma once
2
3// runtime_bootstrap — host-application entry point for wiring framework
4// diagnostics together.
5//
6// What this does
7// --------------
8// `aria::runtime::install_default_diagnostics()` performs two pieces of
9// startup-time wiring:
10//
11// 1. Installs an `aria::CallbackFailureSink` that routes every framework-
12// internal callback failure (executor worker / main-thread drain /
13// simple dispatcher pump / virtual-time advance / async detached
14// tasks / abi slot trampoline) into `aria::runtime::Logger::error`,
15// tagged with the failure's category as the log category.
16//
17// 2. Installs an `aria::abi::SlotInvokeFailureHook` that forwards
18// exceptions escaping the ABI slot trampoline to the same callback-
19// boundary channel — preserving layering (abi does not depend on
20// core) while making slot failures observable end-to-end.
21//
22// Calling pattern
23// ---------------
24// int main(int argc, char** argv) {
25// aria::runtime::install_default_diagnostics();
26// // ... rest of process startup ...
27// }
28//
29// Idempotence
30// -----------
31// The function is idempotent: calling it twice replaces the sink/hook in
32// place without leaking previous installations. `uninstall_default_
33// diagnostics()` reverts both wirings to whatever was in place before the
34// most recent install (typically `nullptr`, i.e. the stderr fallback).
35//
36// Threading
37// ---------
38// Both APIs are thread-safe but are intended to be called once from the
39// process's bootstrap thread before any framework component fires.
40
41#include "aria/abi/export.hpp"
42
43namespace aria::runtime {
44
49
54
55} // namespace aria::runtime
#define ARIA_RUNTIME_API
Definition export.hpp:30
Definition container.hpp:11
void uninstall_default_diagnostics() noexcept
Revert both wirings to whatever they were before the most recent install_default_diagnostics() call.
bool install_default_diagnostics() noexcept
Install the default diagnostics wiring (callback-boundary sink → Logger, abi slot hook → callback bou...