Class BowireWebSocketServiceCollectionExtensions

Namespace
Kuestenlogik.Bowire.Protocol.WebSocket
Assembly
Kuestenlogik.Bowire.Protocol.WebSocket.dll

DI registration helpers for the Bowire WebSocket plugin.

public static class BowireWebSocketServiceCollectionExtensions
Inheritance
BowireWebSocketServiceCollectionExtensions
Inherited Members

Methods

AddBowireWebSocketEndpoints(IServiceCollection, Action<IWebSocketEndpointRegistry>?)

Register the IWebSocketEndpointRegistry singleton the Bowire WebSocket plugin reads on DiscoverAsync, and optionally seed it with a known endpoint list.

Typical embedded-mode use:

services.AddBowireWebSocketEndpoints(registry =>
{
    registry.Add(new WebSocketEndpointInfo("/ws/chat", "Chat", "Group chat"));
    registry.Add(new WebSocketEndpointInfo("/ws/notify", "Notifications", null));
});

Safe to call multiple times — repeated calls re-resolve the singleton and re-invoke any configure action against the same instance. Endpoints discovered from MVC routes via WebSocketEndpointAttribute are merged on top of whatever this registry holds at DiscoverAsync time.

public static IServiceCollection AddBowireWebSocketEndpoints(this IServiceCollection services, Action<IWebSocketEndpointRegistry>? configure = null)

Parameters

services IServiceCollection

The service collection to extend.

configure Action<IWebSocketEndpointRegistry>

Optional seeding action invoked once when the registry is first resolved. Use it to register WebSocket endpoints declaratively at host startup instead of imperatively after the container is built.

Returns

IServiceCollection