Notify clients when campaign ends
This commit is contained in:
@ -8,6 +8,7 @@ namespace Hcs.WebApp.BackgroundServices
|
||||
private readonly ConcurrentQueue<Campaign> campaigns = new();
|
||||
|
||||
public event Action<Campaign> OnCampaignCreated;
|
||||
public event Action<Campaign> OnCampaignEnded;
|
||||
|
||||
public void EnqueueCampaign(Campaign campaign)
|
||||
{
|
||||
@ -20,5 +21,14 @@ namespace Hcs.WebApp.BackgroundServices
|
||||
{
|
||||
return campaigns.TryDequeue(out campaign);
|
||||
}
|
||||
|
||||
public void InvokeOnCampaignEnded(Campaign campaign)
|
||||
{
|
||||
try
|
||||
{
|
||||
OnCampaignEnded?.Invoke(campaign);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user