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

FileWatchDependencyFactory Pennington.Infrastructure

Manages a cached service instance that auto-invalidates when watched files change.

Constructors

FileWatchDependencyFactory

#
public FileWatchDependencyFactory`1(IServiceProvider serviceProvider, ILogger<FileWatchDependencyFactory<T>> logger)

Initializes the factory. FileWatchDispatcher drives invalidation.

Parameters

serviceProvider IServiceProvider
logger ILogger<FileWatchDependencyFactory<T>>

Methods

Dispose

#
public void Dispose()

GetInstance

#
public T GetInstance()

Returns the cached instance, constructing one via DI on first access.

Returns

T

OnFileChanged

#
public FileWatchResponse OnFileChanged(FileChangeNotification change)

Consults the current instance (if one has been built) and drops it when the instance asks to be recreated. Called by FileWatchDispatcher.

Parameters

change FileChangeNotification

Returns

FileWatchResponse

Pennington.Infrastructure.FileWatchDependencyFactory

namespace Pennington.Infrastructure;

/// Manages a cached service instance that auto-invalidates when watched files change.
public class FileWatchDependencyFactory
{
    
public void Dispose()
; /// Initializes the factory. FileWatchDispatcher drives invalidation.
public FileWatchDependencyFactory`1(IServiceProvider serviceProvider, ILogger<FileWatchDependencyFactory<T>> logger)
; /// Returns the cached instance, constructing one via DI on first access.
public T GetInstance()
; /// Consults the current instance (if one has been built) and drops it when the instance asks to be recreated. Called by FileWatchDispatcher.
public FileWatchResponse OnFileChanged(FileChangeNotification change)
; }