public ScriptApplicationHostOptionsSetup(IConfiguration configuration, IOptionsMonitor <StandbyOptions> standbyOptions, IOptionsMonitorCache <ScriptApplicationHostOptions> cache) { _cache = cache ?? throw new ArgumentNullException(nameof(cache)); _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); _standbyOptions = standbyOptions ?? throw new ArgumentNullException(nameof(standbyOptions)); // If standby options change, invalidate this options cache. _standbyOptionsOnChangeSubscription = _standbyOptions.OnChange(o => _cache.Clear()); }
public ConfigureHttpClientOptionsFromCollection(IOptionsMonitor <HttpClientCollectionOptions> optionsSnapshot, IOptionsMonitorCache <HttpClientOptions> cache) { _optionsSnapshot = optionsSnapshot; optionsSnapshot.OnChange((options, name) => { cache.Clear(); }); }
public void Reset() { _cache.Clear(); }