using ZB.MOM.WW.OtOpcUa.Commons.Messages.Drivers;
namespace ZB.MOM.WW.OtOpcUa.AdminUI.Hubs;
///
/// Singleton last-snapshot-per-instance cache. Populated by
/// DriverStatusSignalRBridge as it forwards DPS messages; read by
/// so newly-joined clients see current state
/// without waiting for the next change event, and subscribed to directly by the Blazor
/// Server DriverStatusPanel via .
///
public interface IDriverStatusSnapshotStore
{
/// Stores or replaces the last-known health snapshot for a driver instance.
/// The driver health snapshot to store.
void Upsert(DriverHealthChanged snapshot);
/// Attempts to retrieve the last-known health snapshot for a driver instance.
/// The driver instance's stable logical ID.
/// The stored snapshot, if found.
/// if a snapshot was found; otherwise .
bool TryGet(string driverInstanceId, out DriverHealthChanged snapshot);
/// Returns a point-in-time snapshot of every driver instance's last-known health.
/// A read-only collection of the last-known health snapshot for each driver instance.
IReadOnlyCollection GetAll();
///
/// Raised after every with the just-stored snapshot. Lets in-process
/// consumers (the Blazor Server DriverStatusPanel) receive live updates by reading
/// this singleton directly instead of opening a self-targeted SignalR connection — which a
/// server-side Blazor component cannot reach when the public URL (e.g. a reverse-proxy port)
/// differs from the local Kestrel bind. Handlers run on the caller's thread (the bridge
/// actor), so subscribers must marshal to their own sync context.
///
event Action? SnapshotChanged;
}