17 using System.Collections.Concurrent;
18 using System.Collections.Generic;
29 private readonly ConcurrentDictionary<Symbol, FutureChainCacheEntry> _cache =
new ConcurrentDictionary<Symbol, FutureChainCacheEntry>();
38 _futureChainProvider = futureChainProvider;
51 FutureChainCacheEntry entry;
52 if (!_cache.TryGetValue(symbol, out entry) || date.Date != entry.Date)
54 symbols = _futureChainProvider.GetFutureContractList(symbol, date.Date).ToList();
55 _cache[symbol] =
new FutureChainCacheEntry(date.Date, symbols);
59 symbols = entry.Symbols;
65 private class FutureChainCacheEntry
67 public DateTime Date {
get; }
68 public List<Symbol> Symbols {
get; }
70 public FutureChainCacheEntry(DateTime date, List<Symbol> symbols)