Repository navigation
refactor(data): read the live edge through a port - #143
Merged
Merged
Conversation
The OPC UA live edge needs a second implementation of the live stream, and the stream sat on IDataProvider beside the history reads. The live edge now reads through ILiveSource in SemiPlot.Core/Data, one cold Subscribe(IReadOnlyList<int>) of samples and breaks. Its contract, in data-integration.md#realtime, states that the stream never completes and never faults; TrendCoordinator keeps its Catch for a source that breaks it. The archive poll moves into PostgresLiveSource, its first implementation, with RealtimePoll, the statements and the cadence unchanged. IDataProvider loses Subscribe; TrendCoordinator and TrendWindow.Build take both interfaces from the container. Nothing the operator sees changes. The poll's log lines now carry the PostgresLiveSource source context.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The OPC UA live edge (#116) needs a second implementation of the live stream. The stream sat on
IDataProvider.Subscribebeside the history, extent, days and catalogue reads, so a second source wouldhave had to implement the whole archive surface.
What changed
ILiveSourceinSemiPlot.Core/Data: one coldSubscribe(IReadOnlyList<int>)of samples and breaks.Its contract in
data-integration.md#realtime: the stream never completes and never faults, a nullValueis a break, timestamps are UTC, an id the source does not serve emits nothing.PostgresLiveSourceholds the archive poll, the port's first implementation.RealtimePoll,ArchiveStatementsand the poll cadence are unchanged.IDataProviderlosesSubscribe.TrendCoordinatorandTrendWindow.Buildtake both interfaces; thecoordinator keeps its
Catchfor a source that breaks the contract.data-integration.md,overview.md,charting.md,postgres-topology.md,trend-interaction.md,testing-strategy.md,docs/architecture/README.md,AGENTS.md.Nothing the operator sees changes. The poll's log lines now carry the
PostgresLiveSourcesource context.How it was verified
dotnet build SemiPlot.slnx: 0 errors.dotnet format --verify-no-changesanddotnet terseover the24 touched
.csfiles: exit 0.SemiPlot.Tests.Unit: 2303/2303.SemiPlot.Tests.Integration: 200/200.IDataProvider.Subscribeat the base gives CS1061 atTrendCoordinator.cs:98;TheWindowFollowsTheContainersLiveSourcecatches a cast in place of the container'sILiveSource.roadmap run.
Per-task commits before collapse