hermes-common-library/Common/WebSocketHandlerManager.cs
2024-06-24 22:28:40 +00:00

23 lines
634 B
C#

using CommonSocketLibrary.Abstract;
using CommonSocketLibrary.Common;
using Serilog;
namespace CommonSocketLibrary.Socket.Manager
{
public class WebSocketHandlerManager : HandlerManager<WebSocketClient, IWebSocketHandler>
{
public WebSocketHandlerManager(ILogger logger) : base(logger)
{
}
protected void Add(IWebSocketHandler handler)
{
Add(handler.OperationCode, handler);
}
protected override async Task Execute<T>(WebSocketClient sender, IWebSocketHandler handler, T value)
{
await handler.Execute(sender, value);
}
}
}