refactor: remove ClusterClient streaming path (DebugStreamEvent), events flow via gRPC
This commit is contained in:
@@ -50,10 +50,6 @@ public class InstanceActor : ReceiveActor
|
||||
private readonly Dictionary<string, IActorRef> _alarmActors = new();
|
||||
private FlattenedConfiguration? _configuration;
|
||||
|
||||
// WP-25: Debug view subscribers
|
||||
private readonly HashSet<string> _debugSubscriberCorrelationIds = new();
|
||||
private ActorSelection? _siteCommActor;
|
||||
|
||||
// DCL manager actor reference for subscribing to tag values
|
||||
private readonly IActorRef? _dclManager;
|
||||
// Maps tag paths back to attribute canonical names for DCL updates
|
||||
@@ -150,9 +146,6 @@ public class InstanceActor : ReceiveActor
|
||||
base.PreStart();
|
||||
_logger.LogInformation("InstanceActor started for {Instance}", _instanceUniqueName);
|
||||
|
||||
// Resolve SiteCommunicationActor for routing debug stream events back to central
|
||||
_siteCommActor = Context.ActorSelection("/user/site-communication");
|
||||
|
||||
// Asynchronously load static overrides from SQLite and pipe to self
|
||||
var self = Self;
|
||||
_storage.GetStaticOverridesAsync(_instanceUniqueName).ContinueWith(t =>
|
||||
@@ -370,12 +363,6 @@ public class InstanceActor : ReceiveActor
|
||||
|
||||
// WP-23: Publish to site-wide stream
|
||||
_streamManager?.PublishAlarmStateChanged(changed);
|
||||
|
||||
// Forward to debug subscribers via SiteCommunicationActor → ClusterClient → central
|
||||
foreach (var correlationId in _debugSubscriberCorrelationIds)
|
||||
{
|
||||
_siteCommActor?.Tell(new DebugStreamEvent(correlationId, changed));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -383,9 +370,6 @@ public class InstanceActor : ReceiveActor
|
||||
/// </summary>
|
||||
private void HandleSubscribeDebugView(SubscribeDebugViewRequest request)
|
||||
{
|
||||
var subscriptionId = request.CorrelationId;
|
||||
_debugSubscriberCorrelationIds.Add(subscriptionId);
|
||||
|
||||
// Build snapshot from current state
|
||||
var now = DateTimeOffset.UtcNow;
|
||||
var attributeValues = _attributes.Select(kvp => new AttributeValueChanged(
|
||||
@@ -412,8 +396,8 @@ public class InstanceActor : ReceiveActor
|
||||
Sender.Tell(snapshot);
|
||||
|
||||
_logger.LogDebug(
|
||||
"Debug view subscriber added for {Instance}, subscriptionId={Id}",
|
||||
_instanceUniqueName, subscriptionId);
|
||||
"Debug view snapshot sent for {Instance}, correlationId={Id}",
|
||||
_instanceUniqueName, request.CorrelationId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -421,10 +405,8 @@ public class InstanceActor : ReceiveActor
|
||||
/// </summary>
|
||||
private void HandleUnsubscribeDebugView(UnsubscribeDebugViewRequest request)
|
||||
{
|
||||
_debugSubscriberCorrelationIds.Remove(request.CorrelationId);
|
||||
|
||||
_logger.LogDebug(
|
||||
"Debug view subscriber removed for {Instance}, correlationId={Id}",
|
||||
"Debug view unsubscribe for {Instance}, correlationId={Id}",
|
||||
_instanceUniqueName, request.CorrelationId);
|
||||
}
|
||||
|
||||
@@ -478,12 +460,6 @@ public class InstanceActor : ReceiveActor
|
||||
{
|
||||
alarmActor.Tell(changed);
|
||||
}
|
||||
|
||||
// Forward to debug subscribers via SiteCommunicationActor → ClusterClient → central
|
||||
foreach (var correlationId in _debugSubscriberCorrelationIds)
|
||||
{
|
||||
_siteCommActor?.Tell(new DebugStreamEvent(correlationId, changed));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user