A SignalR backend for projects using Microsoft Orleans.
Wait, isn't there existing SignalR+Orleans backend packages available?!
Yes! I was struggling to get them working properly with a co-hosted project so I decided to build my own. In addition, several of them have switched to target only .net 5, and I needed .net core 3.1 for now (this package targets both).
If you are running into issues with them as well, give this a try! There may be some oversight as this is my first crack at creating a SignalR backend, but please feel free to open an issue if you run into anything.
Reference the package SignalR.Extensions.Orleans
on your standalone cluster, client, and/or co-hosted project.
Install-Package SignalR.Extensions.Orleans or dotnet add package SignalR.Extensions.Orleans |
---|
// applies to both co-hosted and standalone clusters
siloBuilder
.UseLocalHostClustering()
// Add this!
.UseSignalR()
// Add a "PubSubStore" persistence provider if you aren't using Orleans streams yet,
// otherwise you probably already have one added
.AddMemoryGrainStorage("PubSubStore") // MemoryGrainStorage is not recommended for production use
;
If you are not co-hosting, add UseSignalR()
on the ClientBuilder
var client = new ClientBuilder()
// Add this!
.UseSignalR();
.Build();