have akka.net and signalr communicating

This commit is contained in:
2024-03-19 17:17:49 -06:00
parent 09e97fb2fc
commit 9ffd60ac84
17 changed files with 322 additions and 29 deletions

15
Management/SignalRHub.cs Normal file
View File

@@ -0,0 +1,15 @@
using Microsoft.AspNetCore.SignalR;
public class SignalRHub : Hub
{
public async Task SendMessage(string user, string message)
{
await Clients.All.SendAsync("ReceiveMessage", user, message);
}
public override Task OnConnectedAsync()
{
var connectionId = Context.ConnectionId;
// Store the connection ID for later use, e.g., in a database or in-memory store
return base.OnConnectedAsync();
}
}