mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 23:58:31 -06:00
have akka.net and signalr communicating
This commit is contained in:
15
Management/SignalRHub.cs
Normal file
15
Management/SignalRHub.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user