/SignalR

Real-time heart beat monitor prototype using SignalR server-sent events.

Primary LanguageC#

Heart Beat Monitor

Real-time heart beat monitor prototype using SignalR server-sent events.

Usage

To clone and run this application, you'll need Git and .NET 6+ installed on your computer.

From your command line:

# Clone this repository
$ git clone https://github.com/IarahAlmeida/SignalR.git

# Go into the repository
$ cd SignalR/HeartBeatMonitorPlus

# Run the app
$ dotnet run

Copy the URL from the address bar, open another browser instance or tab, and paste the URL in the address bar. The charts are displayed instantly:

SignalR

Architecture and explanation

This project uses the SignalR library to configure a server-sent event hub.

The SignalR Hubs API enables connected clients to call methods on the server. SignalR takes care of everything required to make real-time client-to-server and server-to-client communication possible. In this prototype, a server-sent event hub has been implemented.

SignalR

Here, the client initiates the connection to the server, which is kept open until a cancel request is sent. When new data becomes available on the channel, the response is immediately sent to the client.

The client plots a real-time chart for two different people, and keeps the visualization for the latest 30 records.