- Define ISiteStreamSubscriber interface for decoupling from SiteRuntime - Implement SiteStreamGrpcServer (inherits SiteStreamServiceBase) with: - Readiness gate (SetReady) - Max concurrent stream enforcement - Duplicate correlationId replacement (cancels previous stream) - StreamRelayActor creation per subscription - Bounded Channel<SiteStreamEvent> bridge (1000 capacity, drop-oldest) - Clean teardown: unsubscribe, stop actor, remove tracking entry - Identity-safe cleanup using ConcurrentDictionary.TryRemove(KeyValuePair) to prevent replacement streams from being removed by predecessor cleanup - 7 unit tests covering reject-not-ready, max-streams, duplicate cancel, cleanup-on-cancel, subscribe/remove lifecycle, event forwarding
7.9 KiB
7.9 KiB