Files
mxaccessgw/src/ZB.MOM.WW.MxGateway.Server/Dashboard/IDashboardSnapshotService.cs
T
Joseph Doherty e69cd0321e fix(dashboard): close three low hub/page races (mxaccessgw#174)
D11: BrowsePage search CTS is cancelled+disposed exactly once under a lock.
D12: the hub refreshes the cached health status before seeding a new connection.
D13: DashboardEventBroadcaster gains DisposeAsync that awaits the pumps (bounded).

Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
2026-11-09 12:30:04 -05:00

31 lines
1.3 KiB
C#

namespace ZB.MOM.WW.MxGateway.Server.Dashboard;
/// <summary>
/// Provides snapshots of the dashboard state for UI updates.
/// </summary>
public interface IDashboardSnapshotService
{
/// <summary>
/// Gets the current dashboard snapshot.
/// </summary>
/// <returns>The current dashboard snapshot.</returns>
DashboardSnapshot GetSnapshot();
/// <summary>
/// Watches for changes to the dashboard state as an async enumerable.
/// </summary>
/// <param name="cancellationToken">Token to cancel the asynchronous operation.</param>
/// <returns>An asynchronous stream of dashboard snapshots.</returns>
IAsyncEnumerable<DashboardSnapshot> WatchSnapshotsAsync(CancellationToken cancellationToken);
/// <summary>
/// Re-evaluates the cached gateway health status now. The status otherwise refreshes
/// only on a watch tick, which is suspended while no dashboard viewer is connected,
/// so a first viewer would be seeded with a status from before the idle period.
/// The default does nothing for snapshot sources that have no cached status.
/// </summary>
/// <param name="cancellationToken">Token to cancel the refresh.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
Task RefreshGatewayStatusAsync(CancellationToken cancellationToken) => Task.CompletedTask;
}