in Source/Tx.Core/TypeOccurenceStatistics.cs [80:106]
public void Run()
{
foreach (IInputStream i in _inputs)
{
i.Start();
}
WaitHandle[] handles = (from a in _aggregators select a.Completed).ToArray();
foreach (WaitHandle h in handles)
h.WaitOne();
// Merging collections that are usually small, so no worries about performance
_statistics = new Dictionary<Type, long>();
foreach (TypeOccurenceAggregator a in _aggregators)
{
if (a.Exception != null)
throw a.Exception;
foreach (var pair in a.OccurenceStatistics)
{
if (_statistics.ContainsKey(pair.Key))
_statistics[pair.Key] += pair.Value;
else
_statistics.Add(pair.Key, pair.Value);
}
}
}