Class RemoteConfigPoller
Periodically polls IRemoteConfigSource instances for changes and invokes a callback when new configuration is detected. Falls back to local config when remote sources are unavailable.
public sealed class RemoteConfigPoller : IDisposable
- Inheritance
-
RemoteConfigPoller
- Implements
- Inherited Members
Constructors
RemoteConfigPoller(IEnumerable<IRemoteConfigSource>, Func<string, string, Task>, ILogger?, TimeSpan?)
public RemoteConfigPoller(IEnumerable<IRemoteConfigSource> sources, Func<string, string, Task> onConfigChanged, ILogger? logger = null, TimeSpan? pollInterval = null)
Parameters
sourcesIEnumerable<IRemoteConfigSource>Remote config sources to poll.
onConfigChangedFunc<string, string, Task>Callback invoked when config changes. Receives (sourceName, newContent).
loggerILoggerOptional logger.
pollIntervalTimeSpan?How often to poll. Defaults to 30 seconds.
Properties
IsRunning
Whether the poller is actively running.
public bool IsRunning { get; }
Property Value
SourceCount
Number of registered config sources.
public int SourceCount { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
PollOnceAsync(CancellationToken)
Performs a single poll cycle across all sources. Useful for testing or for on-demand refresh.
public Task PollOnceAsync(CancellationToken ct = default)
Parameters
Returns
Start()
Starts the polling loop.
public void Start()