Sketch7.SignalR.Orleans.AspNet 7.0.0-dev.191

This is a prerelease version of Sketch7.SignalR.Orleans.AspNet.
dotnet add package Sketch7.SignalR.Orleans.AspNet --version 7.0.0-dev.191                
NuGet\Install-Package Sketch7.SignalR.Orleans.AspNet -Version 7.0.0-dev.191                
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="Sketch7.SignalR.Orleans.AspNet" Version="7.0.0-dev.191" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sketch7.SignalR.Orleans.AspNet --version 7.0.0-dev.191                
#r "nuget: Sketch7.SignalR.Orleans.AspNet, 7.0.0-dev.191"                
#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.
// Install Sketch7.SignalR.Orleans.AspNet as a Cake Addin
#addin nuget:?package=Sketch7.SignalR.Orleans.AspNet&version=7.0.0-dev.191&prerelease

// Install Sketch7.SignalR.Orleans.AspNet as a Cake Tool
#tool nuget:?package=Sketch7.SignalR.Orleans.AspNet&version=7.0.0-dev.191&prerelease                

<p align="center"> <img src="https://github.com/dotnet/orleans/blob/gh-pages/assets/logo.png" alt="SignalR.Orleans" width="300px"> <h1>Sketch7 SignalR.Orleans</h1><small>fork from <a href="https://github.com/OrleansContrib/SignalR.Orleans">OrleansContrib/SignalR.Orleans</a></small> </p>

Package build/publish NuGet version

Orleans is a framework that provides a straight-forward approach to building distributed high-scale computing applications, without the need to learn and apply complex concurrency or other scaling patterns.

ASP.NET Core SignalR is a new library for ASP.NET Core developers that makes it incredibly simple to add real-time web functionality to your applications. What is "real-time web" functionality? It's the ability to have your server-side code push content to the connected clients as it happens, in real-time.

Sketch7.SignalR.Orleans is a package that allow us to enhance the real-time capabilities of SignalR by leveraging Orleans distributed cloud platform capabilities.

Installation

Installation is performed via NuGet

dotnet support

Version .NET Orleans Status
1.x netcore2 2.3.5
2.x netcore3 3.2.0
3.x net5 3.5.1
4.x net6 3.6.0 CI
5.x net7 7.2.4 CI
6.x net8 8.0.0 CI
7.x net8 9.0.1 CI

From Package Manager:

PS> Install-Package Sketch7.SignalR.Orleans PS> Install-Package Sketch7.SignalR.Orleans.AspNet

.Net CLI:

# dotnet add package Sketch7.SignalR.Orleans # dotnet add package Sketch7.SignalR.Orleans.AspNet

Paket:

# paket add Sketch7.SignalR.Orleans # paket add Sketch7.SignalR.Orleans.AspNet

Configuration

Silo

We need to configure the Orleans Silo with the below:

  • Use .UseSignalR() on ISiloHostBuilder.

Example

new HostBuilder()
  .UseOrleans((context, siloBuilder) =>
  {
    siloBuilder
      .AddMemoryGrainStorage("PubSubStore") // You can use any other storage provider as long as you have one registered as "PubSubStore".
      .UseSignalR();
  });

Configure Silo Storage Provider and Grain Persistance

Optional configuration to override the default implementation for both providers which by default are set as Memory.

Example

.UseSignalR(signalrBuilder => signalrBuilder.Configure((sb, opts) =>
{
  siloBuilder.AddMemoryGrainStorage(opts.StorageProvider);
}));

Client

Now your SignalR application needs to connect to the Orleans Cluster by using an Orleans Client:

  • Use .UseSignalR() on IClientBuilder.

Example

var hostBuilder = new HostBuilder()
  .UseOrleans((ctx, builder) =>
  {
    builder.UseSignalR()
  });

hostBuilder.RunConsoleAsync();

Somewhere in your Startup.cs:

  • Add the following in ConfigureServices.
  • Use .AddSignalR() on IServiceCollection (this is part of Microsoft.AspNetCore.SignalR nuget package).
  • Use AddOrleans() on .AddSignalR().

Example

public void ConfigureServices(IServiceCollection services)
{
  ...
  services
    .AddSignalR()
    .AddOrleans();
  ...
}

Great! Now you have SignalR configured and Orleans SignalR backplane built in Orleans!

Features

Hub Context

HubContext gives you the ability to communicate with the client from orleans grains (outside the hub).

Sample usage: Receiving server push notifications from message brokers, web hooks, etc. Ideally first update your grain state and then push signalr message to the client.

Example

public class UserNotificationGrain : Grain<UserNotificationState>, IUserNotificationGrain
{
  private HubContext<IUserNotificationHub> _hubContext;

  public override async Task OnActivateAsync()
  {
    _hubContext = GrainFactory.GetHub<IUserNotificationHub>();
    // some code...
    await _hubContext.User(this.GetPrimaryKeyString()).Send("Broadcast", State.UserNotification);
  }
}

Contributions

PRs and feedback are very welcome!

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
7.0.0-dev.191 32 1/20/2025
7.0.0-dev.188 27 1/20/2025
7.0.0-dev.185 28 1/20/2025
7.0.0-dev.182 33 1/16/2025
6.0.1 80 1/20/2025
6.0.0 70 1/15/2025
6.0.0-dev.178 28 1/15/2025
6.0.0-dev.172 407 2/3/2024
6.0.0-dev.170 57 2/2/2024
6.0.0-dev.166 77 1/16/2024
5.0.0 168 1/15/2024
5.0.0-dev.163 69 1/15/2024
5.0.0-dev.162 63 1/15/2024
5.0.0-dev.155 104 12/19/2023
5.0.0-dev.153 211 11/24/2023
5.0.0-dev.152 89 11/24/2023
5.0.0-dev.150 233 11/3/2023
5.0.0-dev.147 125 10/26/2023
5.0.0-dev.144 181 10/9/2023
4.0.4 5,373 8/8/2023
4.0.4-dev.136 91 8/8/2023
4.0.3 447 6/9/2023
4.0.3-dev.129 91 8/2/2023
4.0.3-dev.126 89 6/9/2023
4.0.3-dev.124 85 6/9/2023
4.0.2 171 6/9/2023
4.0.1 205 6/1/2023
4.0.1-dev.113 92 6/9/2023
4.0.1-dev.111 90 6/9/2023
4.0.1-dev.109 87 6/9/2023
4.0.1-dev.107 86 6/9/2023
4.0.1-dev.105 86 6/9/2023
4.0.1-dev.104 85 6/9/2023
4.0.1-dev.103 87 6/9/2023
4.0.1-dev 107 6/8/2023
4.0.0-dev133 5,868 3/9/2022
3.1.0 662 3/8/2022
3.1.0-dev126 176 3/8/2022
3.1.0-dev125 614 1/7/2022
3.1.0-dev122 700 12/2/2021
3.0.0 3,830 4/30/2021
3.0.0-dev117 230 4/30/2021
3.0.0-dev116 212 4/30/2021
3.0.0-dev114 201 4/29/2021
2.0.0 2,020 11/16/2020
2.0.0-rc6 2,079 8/26/2020
2.0.0-rc5 480 8/18/2020
2.0.0-rc4 843 6/11/2020
2.0.0-rc2 361 11/21/2019
2.0.0-rc1 507 11/21/2019
2.0.0-dev99 346 6/11/2020
2.0.0-dev97 319 6/11/2020
2.0.0-dev58 358 11/22/2019
2.0.0-dev43 371 11/21/2019
2.0.0-dev107 286 8/26/2020
2.0.0-dev104 310 8/18/2020
1.0.0-rc8 1,446 3/13/2020
1.0.0-rc7 719 1/17/2020
1.0.0-rc6 658 12/12/2019
1.0.0-rc5 440 12/5/2019
1.0.0-rc4 390 12/5/2019
1.0.0-rc3 405 12/3/2019
1.0.0-rc2 553 11/22/2019
1.0.0-rc1 408 11/21/2019
1.0.0-dev4 347 11/20/2019
1.0.0-dev34 374 11/20/2019
1.0.0-dev3 559 11/1/2019