32 lines
966 B
C#
32 lines
966 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace FinlyticBackend.Hubs;
|
|
|
|
/// <summary>
|
|
/// SignalR Hub broadcasting real-time system diagnostics & microservice health updates to connected clients.
|
|
/// </summary>
|
|
public class SystemHealthHub : Hub
|
|
{
|
|
private readonly ILogger<SystemHealthHub> _logger;
|
|
|
|
public SystemHealthHub(ILogger<SystemHealthHub> logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
public override async Task OnConnectedAsync()
|
|
{
|
|
_logger.LogInformation("[SystemHealthHub] Client connected: ConnectionId={ConnectionId}", Context.ConnectionId);
|
|
await base.OnConnectedAsync();
|
|
}
|
|
|
|
public override async Task OnDisconnectedAsync(Exception? exception)
|
|
{
|
|
_logger.LogInformation("[SystemHealthHub] Client disconnected: ConnectionId={ConnectionId}", Context.ConnectionId);
|
|
await base.OnDisconnectedAsync(exception);
|
|
}
|
|
}
|