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
contentServicesIEnumerable<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
changeFileChangeNotification
Returns
FileWatchResponsePennington.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)
;
}