Sketch7.SignalR.Orleans 7.0.0-dev.191

This is a prerelease version of Sketch7.SignalR.Orleans.
dotnet add package Sketch7.SignalR.Orleans --version 7.0.0-dev.191                
NuGet\Install-Package Sketch7.SignalR.Orleans -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" 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 --version 7.0.0-dev.191                
#r "nuget: Sketch7.SignalR.Orleans, 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 as a Cake Addin
#addin nuget:?package=Sketch7.SignalR.Orleans&version=7.0.0-dev.191&prerelease

// Install Sketch7.SignalR.Orleans as a Cake Tool
#tool nuget:?package=Sketch7.SignalR.Orleans&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 (1)

Showing the top 1 NuGet packages that depend on Sketch7.SignalR.Orleans:

Package Downloads
Sketch7.SignalR.Orleans.AspNet

Orleans backplane for SignalR Core.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
7.0.0-dev.191 30 1/20/2025
7.0.0-dev.188 29 1/20/2025
7.0.0-dev.185 28 1/20/2025
7.0.0-dev.182 34 1/16/2025
6.0.1 74 1/20/2025
6.0.0 68 1/15/2025
6.0.0-dev.178 26 1/15/2025
6.0.0-dev.172 7,435 2/3/2024
6.0.0-dev.170 60 2/2/2024
6.0.0-dev.166 73 1/16/2024
5.0.0 178 1/15/2024
5.0.0-dev.163 65 1/15/2024
5.0.0-dev.162 62 1/15/2024
5.0.0-dev.155 107 12/19/2023
5.0.0-dev.153 217 11/24/2023
5.0.0-dev.152 94 11/24/2023
5.0.0-dev.150 253 11/3/2023
5.0.0-dev.147 129 10/26/2023
5.0.0-dev.144 184 10/9/2023
4.0.4 10,714 8/8/2023
4.0.4-dev.136 97 8/8/2023
4.0.3 509 6/9/2023
4.0.3-dev.129 100 8/2/2023
4.0.3-dev.126 93 6/9/2023
4.0.3-dev.124 92 6/9/2023
4.0.2 205 6/9/2023
4.0.1 228 6/1/2023
4.0.1-dev.113 92 6/9/2023
4.0.1-dev.111 94 6/9/2023
4.0.1-dev.109 91 6/9/2023
4.0.1-dev.107 87 6/9/2023
4.0.1-dev.105 98 6/9/2023
4.0.1-dev.104 89 6/9/2023
4.0.1-dev.103 94 6/9/2023
4.0.1-dev 136 6/8/2023
4.0.0-dev133 5,977 3/9/2022
3.1.0 858 3/8/2022
3.1.0-dev126 195 3/8/2022
3.1.0-dev125 657 1/7/2022
3.1.0-dev122 746 12/2/2021
3.0.0 4,123 4/30/2021
3.0.0-dev117 264 4/30/2021
3.0.0-dev116 250 4/30/2021
3.0.0-dev114 230 4/29/2021
2.0.0 2,407 11/16/2020
2.0.0-rc6 2,303 8/26/2020
2.0.0-rc5 562 8/18/2020
2.0.0-rc4 945 6/11/2020
2.0.0-rc2 421 11/21/2019
2.0.0-rc1 474 11/21/2019
2.0.0-dev99 375 6/11/2020
2.0.0-dev97 369 6/11/2020
2.0.0-dev58 427 11/22/2019
2.0.0-dev43 400 11/21/2019
2.0.0-dev107 328 8/26/2020
2.0.0-dev104 365 8/18/2020
1.0.0-rc8 1,629 3/13/2020
1.0.0-rc7 776 1/17/2020
1.0.0-rc6 716 12/12/2019
1.0.0-rc5 546 12/5/2019
1.0.0-rc4 444 12/5/2019
1.0.0-rc3 488 12/3/2019
1.0.0-rc2 629 11/22/2019
1.0.0-rc1 477 11/21/2019
1.0.0-dev4 422 11/20/2019
1.0.0-dev34 453 11/20/2019
1.0.0-dev3 604 11/1/2019
1.0.0-dev2 411 10/30/2019