Skip to content

Commit

Permalink
what will it do?
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavrax committed Feb 6, 2024
1 parent 8fa589a commit a1408a8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Api/PubnubApi/EventEngine/Core/EffectDispatcher.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Threading;

namespace PubnubApi.EventEngine.Core {
public class EffectDispatcher {
Expand Down Expand Up @@ -52,5 +51,13 @@ public EffectDispatcher Register<TEffectInvocation, TEffectHandler>(TEffectHandl
effectInvocationHandlerMap[typeof(TEffectInvocation)] = handler;
return this;
}

~EffectDispatcher()
{
foreach (var handler in effectInvocationHandlerMap.Values)
{
handler.Cancel().Wait();
}
}
}
}

0 comments on commit a1408a8

Please sign in to comment.