OptionsMonitor<TOptions> constructor
OptionsMonitor<TOptions> (
- OptionsFactory<
TOptions> factory, - Iterable<
OptionsChangeTokenSource< sources,TOptions> > - OptionsMonitorCache<
TOptions> cache
Implementation
OptionsMonitor(
OptionsFactory<TOptions> factory,
Iterable<OptionsChangeTokenSource<TOptions>> sources,
OptionsMonitorCache<TOptions> cache,
) : _factory = factory,
_cache = cache {
for (var source in sources.toList()) {
var registration = ChangeToken.onStateChange(
() => source.getChangeToken(),
_invokeChanged,
source.name,
);
_registrations.add(registration);
}
}