LootDumpProcessor/Process/Collector/HashSetCollector.cs

28 lines
534 B
C#
Raw Normal View History

2023-08-12 19:08:38 +01:00
using LootDumpProcessor.Model.Processing;
namespace LootDumpProcessor.Process.Collector;
public class HashSetCollector : ICollector
{
private readonly HashSet<PartialData> processedDumps = new();
2023-08-12 19:08:38 +01:00
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();
}
}