feat(Backend): update API gateway and websocket hubs
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using System.Threading.Tasks;
|
||||
using FinlyticCore.Dtos.News;
|
||||
|
||||
namespace FinlyticBackend.Hubs;
|
||||
|
||||
/// <summary>
|
||||
/// SignalR Hub for real-time news delivery to connected clients.
|
||||
/// </summary>
|
||||
public class NewsHub : Hub
|
||||
{
|
||||
// Clients can call this to join specific symbol groups if needed later
|
||||
public async Task SubscribeToSymbol(string symbol)
|
||||
{
|
||||
await Groups.AddToGroupAsync(Context.ConnectionId, symbol.ToUpperInvariant());
|
||||
}
|
||||
|
||||
public async Task UnsubscribeFromSymbol(string symbol)
|
||||
{
|
||||
await Groups.RemoveFromGroupAsync(Context.ConnectionId, symbol.ToUpperInvariant());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user