Hosting
A thin
Microsoft.Extensions.DependencyInjectionintegration seam: extension methods that register the engine's top-level singletons (resource registry, allocator, epoch manager, timer, watchdog, paged MMF, database engine) and bind their option types viaIOptions<T>, giving an application a single canonical chain to bootstrap a workingDatabaseEngine. Singleton/Scoped/Transient twins let test and tooling hosts scope an engine instance per DI scope, an injectableIWalFileIOseam swaps the WAL's disk backend for an in-memory one, and small conveniences (AddTyphonProfiler,EnsureFileDeleted) round out startup/teardown for tests and tooling.
๐ฌ Recommended: Hosting doesn't have its own in-depth-overview chapter โ read in-depth-overview/01-foundation.md ยง9 (Chapter 01: Foundation, alongside the primitives it wires up) first to understand the overall design and concepts behind this category, before diving into the specific features below.
Public Features
| Feature | Summary | Status | Level |
|---|---|---|---|
| DI Engine Bootstrap Chain | Add*() extension methods on IServiceCollection that register and wire the engine's top-level singletons into a working DatabaseEngine |
โ Implemented | ๐ข Start Here |
| ย ย โณ Singleton/Scoped/Transient Lifetime Variants | Every Add* with a lifetime choice ships as Add.../AddScoped.../AddTransient... twins sharing one factory delegate |
โ Implemented | ๐ต Core |
| Engine Options Configuration Surface | IOptions<T>-based configuration for engine services, set via configure delegates on each Add*() DI call |
โ Implemented | ๐ต Core |
| ย ย โณ Options Validation Hooks | AddOptions<T>().Validate(...) is wired on every options type but its predicate is a no-op stub today; ResourceOptions.Validate() / PagedMMFOptions.IsValid are the real, directly-callable fail-fast checks |
๐ง Partial | ๐ฃ Advanced |
| Database Seeding | TyphonOptions.Seed(revision, tx => โฆ) registers revision-stepped, crash-safe seed steps applied automatically at engine open โ a fresh database runs them all, an existing one catches up on new ones; DatabaseEngine.IsNewlyCreated is the low-level primitive |
โ Implemented | ๐ข Start Here |
| Clean-Slate Database File Deletion | EnsureFileDeleted<TO>(IServiceProvider) resolves IOptions<TO> in a fresh scope and deletes the backing database file it points at โ the supported way to start test/tooling runs from a clean slate |
โ Implemented | ๐ต Core |
| Profiler Launch Override Hook | AddTyphonProfiler(Func<ProfilerLaunchConfig,ProfilerLaunchConfig>) lets a host adjust the profiler launch config (resolved from typhon.telemetry.json + env) in code, e.g. to layer CLI args on top; zero-code default self-wiring is unaffected if not called |
โ Implemented | ๐ฃ Advanced |
Internal Features
| Feature | Summary | Status |
|---|---|---|
| Pluggable WAL I/O Backend (IWalFileIO seam) | AddDatabaseEngine resolves an optional internal IWalFileIO from the container so tests/benchmarks can register InMemoryWalFileIO and run the full WAL + checkpoint pipeline with zero disk I/O; production falls back to the disk-backed WalFileIO โ the interface and both implementations are internal, not reachable from application code |
โ Implemented |