feat(adminui): add connection-health signal to in-process broadcaster + bridges
This commit is contained in:
@@ -38,13 +38,22 @@ public sealed class AlertSignalRBridge : ReceiveActor
|
||||
_hub = hub;
|
||||
_broadcaster = broadcaster;
|
||||
ReceiveAsync<AlarmTransitionEvent>(ForwardAsync);
|
||||
Receive<SubscribeAck>(_ => { /* DPS confirmation */ });
|
||||
// DPS subscription is now live — mark the feed connected so the Blazor "live" pill lights up.
|
||||
Receive<SubscribeAck>(_ => _broadcaster.SetConnected(true));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void PreStart() =>
|
||||
DistributedPubSub.Get(Context.System).Mediator.Tell(new Subscribe(TopicName, Self));
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void PostStop()
|
||||
{
|
||||
// Bridge stopping — the feed is no longer live, drop the "live" pill.
|
||||
_broadcaster.SetConnected(false);
|
||||
base.PostStop();
|
||||
}
|
||||
|
||||
private async Task ForwardAsync(AlarmTransitionEvent msg)
|
||||
{
|
||||
// In-process fan-out first — this is what the Blazor Server Alerts page reads. The hub push
|
||||
|
||||
Reference in New Issue
Block a user