Class IntentClassifierFileWatcher
Background service that watches the ML.NET model file for changes and hot-swaps the active classifier when the file is updated.
public sealed class IntentClassifierFileWatcher : IHostedService, IDisposable
- Inheritance
-
IntentClassifierFileWatcher
- Implements
- Inherited Members
Constructors
IntentClassifierFileWatcher(IIntentClassifierManager, string, ILogger<IntentClassifierFileWatcher>?)
public IntentClassifierFileWatcher(IIntentClassifierManager manager, string modelPath, ILogger<IntentClassifierFileWatcher>? log = null)
Parameters
managerIIntentClassifierManagermodelPathstringlogILogger<IntentClassifierFileWatcher>
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
StartAsync(CancellationToken)
Triggered when the application host is ready to start the service.
public Task StartAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenIndicates that the start process has been aborted.
Returns
StopAsync(CancellationToken)
Triggered when the application host is performing a graceful shutdown.
public Task StopAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenIndicates that the shutdown process should no longer be graceful.