Add result wait service

This commit is contained in:
2025-10-30 12:25:03 +09:00
parent 3bd7341ecc
commit e31a075f58
10 changed files with 152 additions and 32 deletions

View File

@ -0,0 +1,25 @@
using Hcs.WebApp.Data.Hcs;
using System.Collections.Concurrent;
namespace Hcs.WebApp.BackgroundServices
{
public class ResultWaitState
{
private readonly ConcurrentQueue<Operation> operations = new();
public void EnqueueOperation(Operation operation)
{
operations.Enqueue(operation);
}
public bool TryDequeueOperation(out Operation operation)
{
return operations.TryDequeue(out operation);
}
public bool HasCampaignOperation(int campaignId)
{
return operations.Any(x => x.CampaignId == campaignId);
}
}
}