Soenneker.SignalR.Web.Clients
11.0.1557
Prefix Reserved
dotnet add package Soenneker.SignalR.Web.Clients --version 11.0.1557
NuGet\Install-Package Soenneker.SignalR.Web.Clients -Version 11.0.1557
<PackageReference Include="Soenneker.SignalR.Web.Clients" Version="11.0.1557" />
<PackageVersion Include="Soenneker.SignalR.Web.Clients" Version="11.0.1557" />
<PackageReference Include="Soenneker.SignalR.Web.Clients" />
paket add Soenneker.SignalR.Web.Clients --version 11.0.1557
#r "nuget: Soenneker.SignalR.Web.Clients, 11.0.1557"
#:package Soenneker.SignalR.Web.Clients@11.0.1557
#addin nuget:?package=Soenneker.SignalR.Web.Clients&version=11.0.1557
#tool nuget:?package=Soenneker.SignalR.Web.Clients&version=11.0.1557
Soenneker.SignalR.Web.Clients
A thread-safe, keyed collection of reusable SignalRWebClient instances with coordinated creation and disposal.
Installation
dotnet add package Soenneker.SignalR.Web.Clients
Registration
using Soenneker.SignalR.Web.Clients.Registrars;
builder.Services.AddSignalRWebClientsAsSingleton();
Use AddSignalRWebClientsAsSingleton when connections should live for the application lifetime. AddSignalRWebClientsAsScoped creates a separate keyed collection per dependency-injection scope and disposes its connections when that scope ends.
Creating and using a client
using Microsoft.AspNetCore.SignalR.Client;
using Soenneker.SignalR.Web.Client.Options;
using Soenneker.SignalR.Web.Clients.Abstract;
public sealed class UpdateSubscriber(ISignalRWebClients clients)
{
public async Task Start(CancellationToken cancellationToken)
{
var options = new SignalRWebClientOptions
{
HubUrl = "https://api.example.com/hubs/updates",
AccessTokenProvider = () => Task.FromResult(GetAccessToken())
};
var client = await clients.Get("updates", options, cancellationToken);
client.Connection.On<OrderUpdated>("OrderUpdated", Apply);
await client.EnsureConnection(cancellationToken);
}
}
The identifier defines the cache entry. Concurrent calls for the same identifier receive the same client. Conflicting options for an existing identifier throw by default; omit options to retrieve an existing registration. Callback delegates are compared by identity/equality without invoking them. Options and headers are snapshotted for conflict detection. Always supply valid options when an identifier may not exist yet.
Get creates or retrieves a client but does not start its connection. Register hub handlers before calling StartConnection.
Removing clients
bool removed = await clients.Remove("updates");
Removing an identifier also disposes that client and its underlying SignalR connection. A later Get creates a new instance. Prefer the asynchronous Get and Remove methods because SignalR connection disposal is asynchronous; the synchronous variants block until asynchronous cleanup completes.
Disposing ISignalRWebClients disposes every cached client. Clients returned by the collection are owned by the collection and should not be disposed independently.
Ownership and capacity
SignalRWebClientsOptions.Capacity defaults to 1024, including entries undergoing disposal. New identifiers fail explicitly at capacity; remove unused entries after their consumers finish. Active clients are never silently evicted. RejectConfigurationConflicts = false explicitly restores first-registration-wins behavior.
A concurrent Get waits for removal of its identifier before constructing a replacement. Concurrent removals share disposal; only the initiating removal returns true. Collection disposal rejects new operations and waits for all existing removals.
Singleton identifiers must include the tenant and user identity when credentials or subscriptions differ. Prefer scoped registration for user sessions. Never share a user-specific token provider under a global identifier or independently dispose a borrowed client. Register each hub handler once per client and dispose its subscription when its consumer ends.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.SignalR.Web.Client (>= 11.0.875)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.SignalR.Web.Clients:
| Package | Downloads |
|---|---|
|
Soenneker.Flywheel.Dashboard
A real-time Blazor dashboard for monitoring and managing Soenneker Flywheel. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.1557 | 297 | 11/18/2026 |
| 11.0.1554 | 97 | 11/18/2026 |
| 11.0.1553 | 853 | 11/11/2026 |
| 11.0.1552 | 123 | 11/11/2026 |
| 11.0.1551 | 111 | 11/11/2026 |
| 11.0.1550 | 97 | 11/11/2026 |
| 11.0.1549 | 96 | 11/11/2026 |
| 11.0.1548 | 123 | 11/10/2026 |
| 11.0.1547 | 530 | 11/4/2026 |
| 11.0.1546 | 264 | 11/3/2026 |
| 11.0.1545 | 630 | 10/27/2026 |
| 11.0.1544 | 261 | 10/26/2026 |
| 11.0.1543 | 110 | 10/26/2026 |
| 11.0.1542 | 106 | 10/26/2026 |
| 11.0.1541 | 107 | 10/26/2026 |
| 11.0.1540 | 89 | 10/26/2026 |
| 11.0.1539 | 100 | 10/26/2026 |
| 11.0.1538 | 104 | 10/26/2026 |
| 4.0.1537 | 149 | 10/25/2026 |
| 4.0.1536 | 1,257 | 10/15/2026 |
Updated Multiple NuGet packages