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
serviceProviderIServiceProviderloggerILogger<FileWatchDependencyFactory<T>>
Methods
Dispose
#public void Dispose()
GetInstance
#public T GetInstance()
Returns the cached instance, constructing one via DI on first access.
Returns
TOnFileChanged
#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
changeFileChangeNotification
Returns
FileWatchResponsePennington.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)
;
}