20 using System.Collections.Concurrent;
31 private readonly ConcurrentDictionary<Symbol, IFactorProvider> _cache;
38 _cache =
new ConcurrentDictionary<Symbol, IFactorProvider>();
49 _mapFileProvider = mapFileProvider;
50 _dataProvider = dataProvider;
60 symbol = symbol.GetFactorFileSymbol();
62 if (_cache.TryGetValue(symbol, out factorFile))
69 if (mapFileResolver ==
null)
71 return GetFactorFile(symbol, symbol.
Value);
74 var mapFile = mapFileResolver.ResolveMapFile(symbol);
75 if (mapFile.IsNullOrEmpty())
77 return GetFactorFile(symbol, symbol.
Value);
80 return GetFactorFile(symbol, mapFile.Permtick);
89 var path = Path.Combine(basePath, permtick.ToLowerInvariant() +
".csv");
92 _cache.AddOrUpdate(symbol, factorFile, (s, c) => factorFile);