Refactor WebSocket routing and error handling logic

Replaces `Dictionary` with `ConcurrentDictionary` for thread-safe WebSocket route management and improves error logging with added debug assertions. Also fixes duplicate registrations, enhances dependency injection, updates package references, and adjusts WebSocket attribute structure for better extensibility and usage.
This commit is contained in:
Dmitri Shimanski
2025-05-25 03:32:33 +03:00
parent 59ddda6077
commit c851815a2c
10 changed files with 131 additions and 61 deletions

View File

@@ -21,7 +21,7 @@ namespace yawaflua.WebSockets.Attributes;
/// </remarks>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
[ApiExplorerSettings(IgnoreApi = true)]
public class WebSocketAttribute : RouteAttribute, IRouteTemplateProvider, IApiDescriptionVisibilityProvider
public class WebSocketAttribute : Attribute, IApiDescriptionVisibilityProvider
{
/// <summary>
/// Original route template specified in attribute
@@ -39,7 +39,7 @@ public class WebSocketAttribute : RouteAttribute, IRouteTemplateProvider, IApiDe
/// - Parameters: "/user/{id}"
/// - Constraints: "/file/{name:alpha}"
/// - Optional: "/feed/{category?}"</param>
public WebSocketAttribute([RouteTemplate]string path) : base(path)
public WebSocketAttribute(string path)
{
Template = path;
Name = path;