Files
Joseph Doherty 26ff8d9b4f Initial commit: JDE Scoping Tool migration project
Set up repository with legacy .NET Framework 4.8 source (OLD/),
new .NET 10 Blazor solution (NEW/), OpenSpec specifications,
documentation, and project configuration.
2026-01-02 07:43:29 -05:00

28 lines
858 B
C#
Executable File

using System;
using DataModel.Models;
using Microsoft.AspNet.SignalR;
namespace WebInterface.Hubs
{
public class StatusHub : Hub
{
public static readonly Lazy<IHubContext> ContextInstance = new Lazy<IHubContext>(() => GlobalHost.ConnectionManager.GetHubContext<StatusHub>());
private static StatusUpdate cachedUpdate = new StatusUpdate() {Message="Unknown", Timestamp = DateTime.Now};
public void SetStatus(StatusUpdate statusUpdate)
{
cachedUpdate = statusUpdate;
Clients.All.statusUpdate(statusUpdate);
}
public StatusUpdate GetCachedStatus()
{
return cachedUpdate;
}
public void PublishSearchUpdate(SearchUpdate searchUpdate)
{
Clients.All.searchUpdate(searchUpdate);
}
}
}