Class WsConsumer

Assembly: redb.Route.WebSocket.dll

WebSocket consumer. Embedded Kestrel-based WebSocket server that accepts connections,
receives message frames, and dispatches them into the route processor pipeline.
Supports text and binary frames, subprotocol negotiation, MaxConnections throttling,
and InOut exchange pattern for sending response frames back.

public sealed class WsConsumer : IConsumer

Inheritance

Object→WsConsumer

Implements

Properties

ActiveConnections

Number of currently connected WebSocket clients.

public int ActiveConnections { get; }

BaseUrl

The base URL the server is listening on. Available after Start().

public string? BaseUrl { get; }

ConnectionIds

Ids of the currently connected clients, addressable by a server-mode producer.

public IReadOnlyCollection<string> ConnectionIds { get; }

Endpoint

The endpoint this consumer is attached to (for diagnostics/logging).

public IEndpoint Endpoint { get; }

ProcessedCount

Number of messages successfully processed.

public long ProcessedCount { get; }

Methods

Start(CancellationToken)

Starts consuming messages.

public Task Start(CancellationToken ct = default)

Stop(CancellationToken)

Stops consuming messages.

public Task Stop(CancellationToken ct = default)

Constructors