Table of Contents

Interface IResourceRegistry

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

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

IResource

DataEngine

Data engine subsystem node (DatabaseEngine, ComponentTables).

IResource DataEngine { get; }

Property Value

IResource

Durability

Durability subsystem node (WAL, Checkpoint).

IResource Durability { get; }

Property Value

IResource

Profiler

Profiler subsystem node (Tracy-style consumer thread + exporters).

IResource Profiler { get; }

Property Value

IResource

Root

Root node of the resource tree.

IResource Root { get; }

Property Value

IResource

Runtime

Runtime subsystem node (DAG scheduler, tick loop, worker pool).

IResource Runtime { get; }

Property Value

IResource

Storage

Storage subsystem node (PageCache, ManagedPagedMMF).

IResource Storage { get; }

Property Value

IResource

Synchronization

Synchronization subsystem node (EpochManager, latch pools).

IResource Synchronization { get; }

Property Value

IResource

Timer

Timer subsystem node (high-resolution shared and dedicated timers).

IResource Timer { get; }

Property Value

IResource

TimerDedicated

Timer/Dedicated sub-node for isolated single-handler timers.

IResource TimerDedicated { get; }

Property Value

IResource

Methods

FindByPath(string, string)

Finds a resource by its full path from root.

IResource FindByPath(string path, string separator = "/")

Parameters

path string

Full path (e.g., "Root/DataEngine/DatabaseEngine_abc123/ComponentTable_Player").

separator string

Path 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

subsystem ResourceSubsystem

Returns

IResource

Register<T>(T, ResourceSubsystem)

Registers a resource under the specified subsystem.

IResource Register<T>(T resource, ResourceSubsystem subsystem) where T : IResource

Parameters

resource T
subsystem ResourceSubsystem

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

Event Type

Action<ResourceMutationEventArgs>