26ff8d9b4f
Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
28 lines
858 B
C#
Executable File
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);
|
|
}
|
|
}
|
|
} |