This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

FolderMetadataRegistry Pennington.Content

Aggregates FolderMetadata rows from every IFolderMetadataProvider registered as an IContentService and exposes them as an async-loaded snapshot keyed by canonical folder URL prefix. Registered via AddFileWatched<FolderMetadataRegistry>() so the aggregated table is dropped when any provider's underlying file source changes.

Callers await registry.GetSnapshotAsync() once at the top of their build path (e.g. BuildTreeAsync) and pass the snapshot down through sync recursion. The async load runs on a thread-pool thread; no caller blocks on sync-over-async.

Constructors

FolderMetadataRegistry

#
public FolderMetadataRegistry(IEnumerable<IContentService> contentServices)

Creates a registry that lazily aggregates folder metadata across all registered content services.

Parameters

contentServices IEnumerable<IContentService>

Methods

GetSnapshotAsync

#
public Task<FrozenDictionary<string, FolderMetadata>> GetSnapshotAsync()

Returns the aggregated folder-metadata snapshot, keyed by canonical folder URL prefix (/foo/bar/ form). Materializes on first call; subsequent calls return the same task. The instance is dropped on file-watch invalidation, so the next access rebuilds.

Returns

Task<FrozenDictionary<string, FolderMetadata>>

OnFileChanged

#
public FileWatchResponse OnFileChanged(FileChangeNotification change)

Called on the file-watcher thread for every watched change. Must be quick and thread-safe.

Parameters

change FileChangeNotification

Returns

FileWatchResponse

Pennington.Content.FolderMetadataRegistry

namespace Pennington.Content;

/// Aggregates FolderMetadata rows from every IFolderMetadataProvider registered as an IContentService and exposes them as an async-loaded snapshot keyed by canonical folder URL prefix. Registered via AddFileWatched<FolderMetadataRegistry>() so the aggregated table is dropped when any provider's underlying file source changes. Callers await registry.GetSnapshotAsync() once at the top of their build path (e.g. BuildTreeAsync) and pass the snapshot down through sync recursion. The async load runs on a thread-pool thread; no caller blocks on sync-over-async.
public class FolderMetadataRegistry
{
    /// Creates a registry that lazily aggregates folder metadata across all registered content services.
    
public FolderMetadataRegistry(IEnumerable<IContentService> contentServices)
; /// Returns the aggregated folder-metadata snapshot, keyed by canonical folder URL prefix (/foo/bar/ form). Materializes on first call; subsequent calls return the same task. The instance is dropped on file-watch invalidation, so the next access rebuilds.
public Task<FrozenDictionary<string, FolderMetadata>> GetSnapshotAsync()
; /// Called on the file-watcher thread for every watched change. Must be quick and thread-safe.
public FileWatchResponse OnFileChanged(FileChangeNotification change)
; }