Skip to content

Commit 9f1f522

Browse files
authored
Merge pull request #50991 from v-thpra/azure-triage-fix-1058582
Technical Review 1058582: Introduction to ASP.NET Core SignalR
2 parents 0495eeb + c2b3e00 commit 9f1f522

11 files changed

+37
-37
lines changed

learn-pr/aspnetcore/aspnet-core-signalr/1-introduction.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
unitType: introduction
66
title: Introduction
77
description: This unit introduces you to using real-time web functionality with ASP.NET Core SignalR.
8-
ms.date: 10/25/2023
8+
ms.date: 06/17/2025
99
author: IEvangelist
1010
ms.author: dapine
1111
ms.manager: markl

learn-pr/aspnetcore/aspnet-core-signalr/2-what-is-signalr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: What is ASP.NET Core SignalR?
44
metadata:
55
unitType: learning-content
66
title: What is ASP.NET Core SignalR?
7-
description: In this unit, you'll learn what ASP.NET Core SignalR is.
8-
ms.date: 10/25/2023
7+
description: In this unit, you learn what ASP.NET Core SignalR is.
8+
ms.date: 06/17/2025
99
author: IEvangelist
1010
ms.author: dapine
1111
ms.manager: markl

learn-pr/aspnetcore/aspnet-core-signalr/3-how-signalr-works.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: How ASP.NET Core SignalR works
44
metadata:
55
unitType: learning-content
66
title: How ASP.NET Core SignalR works
7-
description: In this unit, you'll learn how ASP.NET Core SignalR works.
8-
ms.date: 10/25/2023
7+
description: In this unit, you learn how ASP.NET Core SignalR works.
8+
ms.date: 06/17/2025
99
author: IEvangelist
1010
ms.author: dapine
1111
ms.manager: markl

learn-pr/aspnetcore/aspnet-core-signalr/4-when-to-use-signalr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: When to use ASP.NET Core SignalR
44
metadata:
55
unitType: learning-content
66
title: When to use ASP.NET Core SignalR
7-
description: In this unit, you'll learn about when to use ASP.NET Core SignalR.
8-
ms.date: 10/25/2023
7+
description: In this unit, you learn about when to use ASP.NET Core SignalR.
8+
ms.date: 06/17/2025
99
author: IEvangelist
1010
ms.author: dapine
1111
ms.manager: markl

learn-pr/aspnetcore/aspnet-core-signalr/5-knowledge-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: Module assessment
44
metadata:
55
unitType: knowledge_check
66
title: Module assessment
7-
description: Test what you've learned about ASP.NET Core SignalR fundamentals.
8-
ms.date: 10/25/2023
7+
description: Test what you learned about ASP.NET Core SignalR fundamentals.
8+
ms.date: 06/17/2025
99
author: IEvangelist
1010
ms.author: dapine
1111
ms.manager: markl

learn-pr/aspnetcore/aspnet-core-signalr/6-summary.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: Summary
44
metadata:
55
unitType: summary
66
title: Summary
7-
description: This unit summarizes what you've learned about ASP.NET Core SignalR, and it provides links to resources and additional references.
8-
ms.date: 10/25/2023
7+
description: This unit summarizes what you learned about ASP.NET Core SignalR, and it provides links to resources and more references.
8+
ms.date: 06/17/2025
99
author: IEvangelist
1010
ms.author: dapine
1111
ms.manager: markl

learn-pr/aspnetcore/aspnet-core-signalr/includes/1-introduction.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ ASP.NET Core SignalR is an open-source library that simplifies adding real-time
22

33
## Example scenario
44

5-
Imagine you're part of a development team that's been asked to update the live app feature of an existing website. The live map is part of an ordering system that lets Contoso Pizza customers track the progress of their orders.
5+
Imagine you're part of a development team tasked with updating the live map feature of an existing website. The live map is part of an ordering system that lets Contoso Pizza customers track the progress of their orders.
66

77
The current solution is implemented through client-side polling for order status change updates. This method is less than ideal, because it has the potential to flood the server with requests. Contoso Pizza has been receiving reports of orders that fail to be processed, resulting in a loss of sales and, potentially, loss of repeat customers.
88

9-
The failures that are reported in the logs occur during peak hours of the sales day. When too many customers view the live order map at the same time, the server is overwhelmed with requests and the process fails. In this module, you'll use SignalR to address these concerns.
9+
The failures that are reported in the logs occur during peak hours of the sales day. When too many customers view the live order map at the same time, the server is overwhelmed with requests and the process fails. In this module, you use SignalR to address these concerns.
1010

11-
## What will we be doing?
11+
## What are you going to do?
1212

13-
In this module, you'll learn the common terminology associated with SignalR, what it is, and how it works. You'll learn when SignalR is appropriate to use and when it's not the best solution. Finally, you'll check your knowledge of SignalR by answering a few key questions.
13+
In this module, you learn the common terminology associated with SignalR, what it is, and how it works. You learn when SignalR is appropriate to use and when it's not the best solution. Finally, you check your knowledge of SignalR by answering a few key questions.
1414

1515
## What is the main goal?
1616

17-
By the end of this session, you'll be familiar with SignalR terminology. You'll have a fundamental understanding of its capabilities and limitations. With this knowledge, you'll be able to help decide whether SignalR is a viable option for your team.
17+
By the end of this module, you're familiar with SignalR terminology and have a fundamental understanding of its capabilities and limitations. With this knowledge, you're able to help decide whether SignalR is a viable option for your team.

learn-pr/aspnetcore/aspnet-core-signalr/includes/2-what-is-signalr.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
All internet-connected applications are composed of servers and clients. Clients rely on servers for data, and their primary mechanism for receiving data is through making Hypertext Transfer Protocol (HTTP) requests. Some client applications require data that changes frequently.
22

3-
ASP.NET Core SignalR provides an API for creating server-to-client remote procedure calls (RPCs). RPCs invoke functions on clients from the server-side .NET Core code. There are several supported platforms, each with its own client SDK. Therefore, the programming language being invoked by RPC calls can vary.
3+
ASP.NET Core SignalR provides an API for creating server-to-client remote procedure calls (RPCs). RPCs invoke functions on clients from the server-side .NET Core code. There are several supported platforms, each with its own client SDK. Therefore, the programming language that the RPC calls invoke can vary.
44

5-
It's helpful to familiarize yourself with the common terminology that's associated with SignalR. In this unit, you'll learn what SignalR components are required in a server application, versus those in client applications. Additionally, you'll gain an understanding of the various duplex communication mechanisms. SignalR encapsulates multiple real-time protocols, and abstracts away the complexities of each implementation. For more information, see the [ASP.NET Core SignalR](/aspnet/core/signalr/introduction) documentation.
5+
It's helpful to familiarize yourself with the common terminology associated with SignalR. In this unit, you learn what SignalR components are required in a server application and in client applications. Additionally, you gain an understanding of the various duplex communication mechanisms. SignalR encapsulates multiple real-time protocols, and abstracts away the complexities of each implementation. For more information, see the [ASP.NET Core SignalR](/aspnet/core/signalr/introduction) documentation.
66

77
The principal terms that are used in SignalR are discussed in the following sections.
88

@@ -26,20 +26,20 @@ In SignalR, a *hub* is used to communicate between clients and servers. A hub is
2626

2727
#### Protocols
2828

29-
The SignalR Protocol is a protocol for a two-way RPC over any [message-based transport](#transports). Either party in the connection can invoke procedures on the other party, and procedures can return zero or more results or an error. SignalR provides two built-in hub protocols:
29+
The SignalR Protocol is a protocol for a two-way RPC over any message-based transport. Either party in the connection can invoke procedures on the other party, and procedures can return zero or more results or an error. SignalR provides two built-in hub protocols:
3030

31-
- A text protocol that's based on JSON, which is the default.
32-
- A binary protocol that's based on *MessagePack*, which generally creates smaller messages than JSON does.
31+
- A text protocol based on JSON, which is the default.
32+
- A binary protocol based on *MessagePack*, which generally creates smaller messages than JSON does.
3333

34-
To use the *MessagePack* protocol, both server and client need to opt in to configuring it, and both server and client have to support it. There's a third hub protocol, called *BlazorPack*, but it's used exclusively with Blazor-Server applications. It can't be used *without* the Blazor-Server hosting model. For more information, see the official specification for [SignalR Hub Protocol](https://github.com/dotnet/aspnetcore/blob/068797e16a1bfe66461e15c8a2ffa864369d384d/src/SignalR/docs/specs/HubProtocol.md).
34+
To use the *MessagePack* protocol, both server and client need to opt in to configuring it, and both server and client have to support it. There's a third hub protocol used exclusively with Blazor-Server applications, called *BlazorPack*. It can't be used *without* the Blazor-Server hosting model. For more information, see the official specification for [SignalR Hub Protocol](https://github.com/dotnet/aspnetcore/blob/068797e16a1bfe66461e15c8a2ffa864369d384d/src/SignalR/docs/specs/HubProtocol.md).
3535

3636
#### Users
3737

38-
A user in the system acts as an individual, but can also be part of a group. Messages can be sent to [groups](#groups), and all group members are notified. A single user can connect from multiple client applications. For example, the same user can use a mobile device and a web browser and get real-time updates on both at the same time.
38+
A user in the system acts as an individual, but can also be part of a group. Messages can be sent to groups, and all group members are notified. A single user can connect from multiple client applications. For example, the same user can use a mobile device and a web browser and get real-time updates on both at the same time.
3939

4040
#### Groups
4141

42-
A group consists of one or more [connections](#connections). The server can create groups, add connections to a group, and remove connections from a group. A group has a specified name, which acts as its unique identifier. Groups serve as a scoping mechanism to help target messages. That is, real-time functionality can only be sent to users within a named group.
42+
A group consists of one or more connections. The server can create groups, add connections to a group, and remove connections from a group. A group has a specified name, which acts as its unique identifier. Groups serve as a scoping mechanism to help target messages. That is, real-time functionality can only be sent to users within a named group.
4343

4444
#### Connections
4545

learn-pr/aspnetcore/aspnet-core-signalr/includes/3-how-signalr-works.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Servers and the `Hub` class
22

3-
The `Hub` class is a SignalR server concept. It's defined within the `Microsoft.AspNetCore.SignalR` namespace and is part of the [Microsoft.AspNetCore.SignalR](https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR) NuGet package. ASP.NET Core web apps that target the Microsoft.NET.Sdk.Web SDK don't need to add a package reference for SignalR, because it's already available as part of the [shared framework](/aspnet/core/fundamentals/metapackage-app).
3+
The `Hub` class is a SignalR server concept defined within the `Microsoft.AspNetCore.SignalR` namespace that is part of the [Microsoft.AspNetCore.SignalR](https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR) NuGet package. ASP.NET Core web apps that target the Microsoft.NET.Sdk.Web SDK don't need to add a package reference for SignalR, because it's already available as part of the [shared framework](/aspnet/core/fundamentals/metapackage-app).
44

55
A `Hub` is exposed through a *route*. For example, the `https://www.contoso-pizza.com/hubs/orders` route could be used to represent an `OrdersHub` implementation. Through the various hub APIs, authors can define methods and events.
66

@@ -46,7 +46,7 @@ You fire [events](#events) from either a `Hub` or an `IHubContext` instance. The
4646
- <xref:Microsoft.AspNetCore.SignalR.IHubContext%602>: A context where `THub` represents a strongly typed generic hub, and `T` represents the corresponding type of client.
4747

4848
> [!IMPORTANT]
49-
> `IHubContext` is for sending notifications to clients. It is *not* used to call methods on the `Hub`.
49+
> `IHubContext` is used for sending notifications to clients, *not* for calling methods on the `Hub`.
5050
5151
#### An example `IHubContext`
5252

@@ -70,7 +70,7 @@ public sealed class NotificationService(
7070
}
7171
```
7272

73-
The preceding C# code relies on `IHubContext<NotificationHub>` to access the contextual listing of clients, exposing the ability to broadcast notifications. The `hubContext` primary constructor parameter that's captured in scope is used to fire the `"NotificationReceived"` event, but it isn't intended to be used to call the hub's `NotifyAll` method.
73+
The preceding C# code relies on `IHubContext<NotificationHub>` to access the contextual listing of clients, exposing the ability to broadcast notifications. The `hubContext` primary constructor parameter is captured in scope and used to fire the `"NotificationReceived"` event, but it isn't intended to be used to call the hub's `NotifyAll` method.
7474

7575
### Methods
7676

@@ -84,7 +84,7 @@ Methods aren't required to fire events, but they often do.
8484

8585
### Events
8686

87-
An event can be subscribed to by name from a client. The server is responsible for raising events. `Hub`, `Hub<T>`, `IHubContext<THub>`, and `IHubContext<THub, T>` events are *named* and can define up to 10 parameters. Events are fired on the server and handled by interested clients. A client is considered interested when it subscribes to events on its hub's connection. Clients can indirectly trigger events when they call hub methods that fire events as a result of their invocation. Events can't be directly triggered by clients, though, because that's the responsibility of the server.
87+
The server is responsible for raising events. A client can subscribe to an event by name. `Hub`, `Hub<T>`, `IHubContext<THub>`, and `IHubContext<THub, T>` events are *named* and can define up to 10 parameters. Events are fired on the server and handled by interested clients. A client is considered interested when it subscribes to events on its hub's connection. Clients can indirectly trigger events when they call hub methods that fire events as a result of their invocation. Clients can't directly trigger events, though, because that's the responsibility of the server.
8888

8989
#### Event client scopes
9090

@@ -124,13 +124,13 @@ Consider the following images, which can help you visualize how the hub sends me
124124

125125
- **Broadcast to all**
126126

127-
:::image type="content" source="../media/signalr-all.png" lightbox="../media/signalr-all-large.png" alt-text="ASP.NET Core SignalR hub sending message with Clients.All syntax.":::
127+
:::image type="content" source="../media/signalr-all.png" lightbox="../media/signalr-all-large.png" alt-text="ASP.NET Core SignalR hub sending a message with Clients.All syntax.":::
128128

129129
All connected clients receive this message, regardless of the group that they might or might not belong to.
130130

131131
- **Isolated user**
132132

133-
:::image type="content" source="../media/signalr-user.png" lightbox="../media/signalr-user-large.png" alt-text="ASP.NET Core SignalR hub sending message with Clients.User syntax.":::
133+
:::image type="content" source="../media/signalr-user.png" lightbox="../media/signalr-user-large.png" alt-text="ASP.NET Core SignalR hub sending a message with Clients.User syntax.":::
134134

135135
A single user receives this message, regardless of how many devices they're currently using.
136136

@@ -142,9 +142,9 @@ Consider the following images, which can help you visualize how the hub sends me
142142

143143
## Clients and the `HubConnection` class
144144

145-
The `HubConnection` class is a SignalR client concept, which represents the client's connection to the [server `Hub`](#servers-and-the-hub-class). It's defined within the `Microsoft.AspNetCore.SignalR.Client` namespace, and it's part of the [Microsoft.AspNetCore.SignalR.Client](https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR.Client) NuGet package.
145+
The `HubConnection` class is a SignalR client concept, which represents the client's connection to the [server `Hub`](#servers-and-the-hub-class). The class is defined within the `Microsoft.AspNetCore.SignalR.Client` namespace, and it's part of the [Microsoft.AspNetCore.SignalR.Client](https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR.Client) NuGet package.
146146

147-
You create a `HubConnection` by using the builder pattern and the corresponding `HubConnectionBuilder` type. Given the hub's route (or <xref:System.Uri?displayProperty=fullName>), you can create a `HubConnection`. The builder can also specify additional configuration options, including logging, the desired protocol, authentication token forwarding, and automatic reconnection, among others.
147+
You create a `HubConnection` by using the builder pattern and the corresponding `HubConnectionBuilder` type. Given the hub's route (or <xref:System.Uri?displayProperty=fullName>), you can create a `HubConnection`. The builder can also specify more configuration options. Including, logging, the desired protocol, authentication token forwarding, and automatic reconnection, among others.
148148

149149
The `HubConnection` API exposes start and stop functions, which you use to start and stop the connection to the server. Additionally, there are capabilities for streaming, calling [hub methods](#methods), and subscribing to [events](#events).
150150

learn-pr/aspnetcore/aspnet-core-signalr/includes/4-when-to-use-signalr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Knowing when *not* to choose SignalR is as important as knowing when to choose i
88

99
SignalR is only as durable as its underlying connection. That is, if there's cause for concern with the *connectivity* of a client application, SignalR isn't the best choice.
1010

11-
Another consideration is the scalability of SignalR. Depending on the number of concurrently connected clients, your web server could experience *resource contention* when it reaches its limits. In situations like this, you would likely need to deploy the application to a server farm and use a backplane. Implementing this on your own can be tedious.
11+
Another consideration is the scalability of SignalR. Depending on the number of concurrently connected clients, your web server could experience *resource contention* when it reaches its limits. In situations like this, you would likely need to deploy the application to a server farm and use a backplane. Implementing this solution on your own can be tedious.
1212

1313
Alternatively, you could resolve this problem by using the [Azure SignalR Service](/azure/azure-signalr). Or you could help alleviate it by taking advantage of various [resiliency and disaster recovery](/azure/azure-signalr/signalr-concept-disaster-recovery) mechanisms.
1414

0 commit comments

Comments
 (0)