hermes-common-library/Common/WebSocketHandlerManager.cs

23 lines
634 B
C#
Raw Permalink Normal View History

2024-06-24 18:28:40 -04:00
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);
}
}
}