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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.SignalR.Web.Clients" Version="11.0.1557" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.SignalR.Web.Clients" Version="11.0.1557" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.SignalR.Web.Clients" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.SignalR.Web.Clients --version 11.0.1557
                    
#r "nuget: Soenneker.SignalR.Web.Clients, 11.0.1557"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.SignalR.Web.Clients@11.0.1557
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.SignalR.Web.Clients&version=11.0.1557
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.SignalR.Web.Clients&version=11.0.1557
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed

Updated Multiple NuGet packages