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
                    
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.1503" />
                    
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.1503" />
                    
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.1503
                    
#r "nuget: Soenneker.SignalR.Web.Clients, 4.0.1503"
                    
#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.1503
                    
#: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.1503
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.SignalR.Web.Clients&version=4.0.1503
                    
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.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
Loading failed

Updated Multiple NuGet packages