Interface IWebSocketEndpointRegistry
- Namespace
- Kuestenlogik.Bowire.Protocol.WebSocket
- Assembly
- Kuestenlogik.Bowire.Protocol.WebSocket.dll
Per-container catalogue of WebSocketEndpointInfo
instances Bowire's WebSocket plugin should surface in
DiscoverAsync, on top of anything the plugin finds via
WebSocketEndpointAttribute on routed endpoints.
Registered as a singleton through
AddBowireWebSocketEndpoints(IServiceCollection, Action<IWebSocketEndpointRegistry>?).
Replaces the pre-v1.7 process-wide static collection on
BowireWebSocketProtocol: a per-container instance keeps
each ASP.NET host's endpoint list independent (tests, side-by-side
in-process hosts) and removes the cross-test races the static
collection produced.
public interface IWebSocketEndpointRegistry
Methods
Add(WebSocketEndpointInfo)
Append an endpoint to the registry. Thread-safe. Throws
ArgumentNullException if endpoint
is null.
void Add(WebSocketEndpointInfo endpoint)
Parameters
endpointWebSocketEndpointInfo
Snapshot()
Stable snapshot of the registered endpoints at the moment of the call. The returned list is detached from the registry's internal storage — concurrent Add(WebSocketEndpointInfo) calls after the snapshot don't mutate it.
IReadOnlyList<WebSocketEndpointInfo> Snapshot()