LootDumpProcessor/Process/Collector/HashSetCollector.cs

26 lines
536 B
C#
Raw Normal View History

using LootDumpProcessor.Model.Processing;
2023-08-12 19:08:38 +01:00
namespace LootDumpProcessor.Process.Collector;
public class HashSetCollector : ICollector
{
private readonly HashSet<PartialData> processedDumps = new(100_000);
private readonly object lockObject = new();
2023-08-12 19:08:38 +01:00
public void Setup()
{
}
public void Hold(PartialData outputData)
{
lock (lockObject)
{
processedDumps.Add(outputData);
}
}
public List<PartialData> Retrieve()
{
return processedDumps.ToList();
}
}