Soenneker.SignalR.Web.Clients
4.0.1503
Prefix Reserved
dotnet add package Soenneker.SignalR.Web.Clients --version 4.0.1503
NuGet\Install-Package Soenneker.SignalR.Web.Clients -Version 4.0.1503
<PackageReference Include="Soenneker.SignalR.Web.Clients" Version="4.0.1503" />
<PackageVersion Include="Soenneker.SignalR.Web.Clients" Version="4.0.1503" />
<PackageReference Include="Soenneker.SignalR.Web.Clients" />
paket add Soenneker.SignalR.Web.Clients --version 4.0.1503
#r "nuget: Soenneker.SignalR.Web.Clients, 4.0.1503"
#:package Soenneker.SignalR.Web.Clients@4.0.1503
#addin nuget:?package=Soenneker.SignalR.Web.Clients&version=4.0.1503
#tool nuget:?package=Soenneker.SignalR.Web.Clients&version=4.0.1503
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.StartConnection(cancellationToken);
}
}
The identifier defines the cache entry. Concurrent calls for the same identifier receive the same client. Options are used only when that identifier is first created; later calls return the existing instance rather than reconfiguring it. 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.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Soenneker.Dictionaries.Singletons (>= 4.0.107)
- Soenneker.SignalR.Web.Client (>= 4.0.826)
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 |
|---|---|---|
| 4.0.1503 | 0 | 9/17/2026 |
| 4.0.1502 | 0 | 9/16/2026 |
| 4.0.1501 | 0 | 9/16/2026 |
| 4.0.1500 | 0 | 9/16/2026 |
| 4.0.1499 | 24 | 9/16/2026 |
| 4.0.1498 | 32 | 9/16/2026 |
| 4.0.1497 | 39 | 9/15/2026 |
| 4.0.1496 | 34 | 9/15/2026 |
| 4.0.1495 | 255 | 9/13/2026 |
| 4.0.1493 | 106 | 9/13/2026 |
| 4.0.1492 | 50 | 9/13/2026 |
| 4.0.1491 | 76 | 9/12/2026 |
| 4.0.1490 | 49 | 9/12/2026 |
| 4.0.1489 | 104 | 9/12/2026 |
| 4.0.1488 | 52 | 9/12/2026 |
| 4.0.1486 | 345 | 9/9/2026 |
| 4.0.1485 | 92 | 9/9/2026 |
| 4.0.1484 | 164 | 9/8/2026 |
| 4.0.1483 | 211 | 9/8/2026 |
| 4.0.1482 | 93 | 9/7/2026 |
Updated Multiple NuGet packages