Fix warning
This commit is contained in:
@@ -7,7 +7,7 @@ using System.Text;
|
||||
|
||||
namespace MareSynchronos.Services.Mediator;
|
||||
|
||||
public sealed class MareMediator : IHostedService
|
||||
public sealed class MareMediator : IHostedService, IDisposable
|
||||
{
|
||||
private readonly Lock _addRemoveLock = new();
|
||||
private readonly ConcurrentDictionary<SubscriberAction, DateTime> _lastErrorTime = [];
|
||||
@@ -109,6 +109,12 @@ public sealed class MareMediator : IHostedService
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_loopCts.Cancel();
|
||||
_loopCts.Dispose();
|
||||
}
|
||||
|
||||
public void SubscribeKeyed<T>(IMediatorSubscriber subscriber, string key, Action<T> action) where T : MessageBase
|
||||
{
|
||||
lock (_addRemoveLock)
|
||||
@@ -219,4 +225,4 @@ public sealed class MareMediator : IHostedService
|
||||
public object Action { get; }
|
||||
public IMediatorSubscriber Subscriber { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user