21 using System.Collections.Generic;
34 private readonly DateTime _date;
47 : base(dataCacheProvider, isLiveMode, objectStore)
51 _dataProvider = dataProvider;
55 throw new ArgumentException($
"{nameof(IndexSubscriptionDataSourceReader)} should be used" +
56 $
"with a data type which implements {nameof(IndexedBaseData)}");
71 if (reader ==
null || reader.EndOfStream)
73 OnInvalidSource(source,
new Exception($
"The reader was empty for source: ${source.Source}"));
78 while (!reader.EndOfStream)
81 var line = reader.ReadLine();
82 if (line.IsNullOrEmpty())
90 dataSource = _factory.GetSourceForAnIndex(_config, _date, line,
IsLiveMode);
94 OnInvalidSource(source,
new Exception(
"Factory.GetSourceForAnIndex() failed to return a valid source"));
98 if (dataSource !=
null)
110 var enumerator = dataReader.
Read(dataSource).GetEnumerator();
111 while (enumerator.MoveNext())
113 yield
return enumerator.Current;
115 enumerator.DisposeSafely();