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 48 1/20/2025
7.0.0-dev.188 45 1/20/2025
7.0.0-dev.185 45 1/20/2025
7.0.0-dev.182 46 1/16/2025
6.0.1 142 1/20/2025
6.0.0 79 1/15/2025
6.0.0-dev.178 35 1/15/2025
6.0.0-dev.172 7,474 2/3/2024
6.0.0-dev.170 62 2/2/2024
6.0.0-dev.166 75 1/16/2024
5.0.0 181 1/15/2024
5.0.0-dev.163 67 1/15/2024
5.0.0-dev.162 64 1/15/2024
5.0.0-dev.155 107 12/19/2023
5.0.0-dev.153 219 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,717 8/8/2023
4.0.4-dev.136 97 8/8/2023
4.0.3 511 6/9/2023
4.0.3-dev.129 100 8/2/2023
4.0.3-dev.126 95 6/9/2023
4.0.3-dev.124 100 6/9/2023
4.0.2 207 6/9/2023
4.0.1 231 6/1/2023
4.0.1-dev.113 94 6/9/2023
4.0.1-dev.111 96 6/9/2023
4.0.1-dev.109 93 6/9/2023
4.0.1-dev.107 89 6/9/2023
4.0.1-dev.105 100 6/9/2023
4.0.1-dev.104 91 6/9/2023
4.0.1-dev.103 96 6/9/2023
4.0.1-dev 138 6/8/2023
4.0.0-dev133 5,984 3/9/2022
3.1.0 866 3/8/2022
3.1.0-dev126 203 3/8/2022
3.1.0-dev125 666 1/7/2022
3.1.0-dev122 755 12/2/2021
3.0.0 4,132 4/30/2021
3.0.0-dev117 273 4/30/2021
3.0.0-dev116 259 4/30/2021
3.0.0-dev114 239 4/29/2021
2.0.0 2,419 11/16/2020
2.0.0-rc6 2,313 8/26/2020
2.0.0-rc5 572 8/18/2020
2.0.0-rc4 955 6/11/2020
2.0.0-rc2 433 11/21/2019
2.0.0-rc1 486 11/21/2019
2.0.0-dev99 385 6/11/2020
2.0.0-dev97 379 6/11/2020
2.0.0-dev58 439 11/22/2019
2.0.0-dev43 412 11/21/2019
2.0.0-dev107 338 8/26/2020
2.0.0-dev104 375 8/18/2020
1.0.0-rc8 1,641 3/13/2020
1.0.0-rc7 788 1/17/2020
1.0.0-rc6 728 12/12/2019
1.0.0-rc5 558 12/5/2019
1.0.0-rc4 456 12/5/2019
1.0.0-rc3 506 12/3/2019
1.0.0-rc2 641 11/22/2019
1.0.0-rc1 489 11/21/2019
1.0.0-dev4 434 11/20/2019
1.0.0-dev34 465 11/20/2019
1.0.0-dev3 617 11/1/2019
1.0.0-dev2 424 10/30/2019