Soenneker.SignalR.Web.Clients 4.0.1514

Prefix Reserved
dotnet add package Soenneker.SignalR.Web.Clients --version 4.0.1514
                    
NuGet\Install-Package Soenneker.SignalR.Web.Clients -Version 4.0.1514
                    
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="4.0.1514" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.SignalR.Web.Clients" Version="4.0.1514" />
                    
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 4.0.1514
                    
#r "nuget: Soenneker.SignalR.Web.Clients, 4.0.1514"
                    
#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@4.0.1514
                    
#: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=4.0.1514
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.SignalR.Web.Clients&version=4.0.1514
                    
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.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 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. 
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
4.0.1514 1,005 9/30/2026
4.0.1513 295 9/29/2026
4.0.1512 110 9/29/2026
4.0.1511 104 9/29/2026
4.0.1510 102 9/29/2026
4.0.1509 551 9/25/2026
4.0.1508 132 9/25/2026
4.0.1507 92 9/25/2026
4.0.1506 112 9/24/2026
4.0.1505 94 9/24/2026
4.0.1504 308 9/22/2026
4.0.1503 653 9/17/2026
4.0.1502 116 9/16/2026
4.0.1501 108 9/16/2026
4.0.1500 97 9/16/2026
4.0.1499 102 9/16/2026
4.0.1498 94 9/16/2026
4.0.1497 97 9/15/2026
4.0.1496 93 9/15/2026
4.0.1495 396 9/13/2026
Loading failed

Updated Soenneker.Dictionaries.Singletons to 4.0.113