LootDumpProcessor/Process/Collector/HashSetCollector.cs
chomp 6e4c7abf73 dump-processor-cleanup (#6)
Co-authored-by: Alex <alex@dm-me-for-questions.com>
Reviewed-on: SPT-AKI/LootDumpProcessor#6
2024-04-16 18:29:40 +00:00

26 lines
536 B
C#

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