Interface IResourceRegistry
Central registry for all managed resources in Typhon. Provides a hierarchical tree structure for lifecycle management and observability.
public interface IResourceRegistry : IDisposable
- Inherited Members
Remarks
One IResourceRegistry exists per process. Multiple DatabaseEngine instances are siblings under the same registry.
Design: No orphan container exists. Resources must have an explicit parent; passing null throws ArgumentNullException. This fails fast and surfaces bugs.
Properties
Allocation
Allocation subsystem node (MemoryAllocator, Bitmaps).
IResource Allocation { get; }
Property Value
DataEngine
Data engine subsystem node (DatabaseEngine, ComponentTables).
IResource DataEngine { get; }
Property Value
Durability
Durability subsystem node (WAL, Checkpoint).
IResource Durability { get; }
Property Value
Profiler
Profiler subsystem node (Tracy-style consumer thread + exporters).
IResource Profiler { get; }
Property Value
Root
Root node of the resource tree.
IResource Root { get; }
Property Value
Runtime
Runtime subsystem node (DAG scheduler, tick loop, worker pool).
IResource Runtime { get; }
Property Value
Storage
Storage subsystem node (PageCache, ManagedPagedMMF).
IResource Storage { get; }
Property Value
Synchronization
Synchronization subsystem node (EpochManager, latch pools).
IResource Synchronization { get; }
Property Value
Timer
Timer subsystem node (high-resolution shared and dedicated timers).
IResource Timer { get; }
Property Value
TimerDedicated
Timer/Dedicated sub-node for isolated single-handler timers.
IResource TimerDedicated { get; }
Property Value
Methods
FindByPath(string, string)
Finds a resource by its full path from root.
IResource FindByPath(string path, string separator = "/")
Parameters
pathstringFull path (e.g., "Root/DataEngine/DatabaseEngine_abc123/ComponentTable_Player").
separatorstringPath separator (default: "/").
Returns
- IResource
The resource at the path, or null if not found.
GetSubsystem(ResourceSubsystem)
Gets the subsystem node for the specified category.
IResource GetSubsystem(ResourceSubsystem subsystem)
Parameters
subsystemResourceSubsystem
Returns
Register<T>(T, ResourceSubsystem)
Registers a resource under the specified subsystem.
IResource Register<T>(T resource, ResourceSubsystem subsystem) where T : IResource
Parameters
resourceTsubsystemResourceSubsystem
Returns
- IResource
The subsystem node (for fluent chaining or parent assignment).
Type Parameters
T
Events
NodeMutated
Raised whenever a resource is added to or removed from the graph. Subscribers must not throw (the registry isolates faulty handlers but fault-tolerance is best-effort) and must not mutate the graph from within the handler (would re-enter and cause recursive raise).
event Action<ResourceMutationEventArgs> NodeMutated