File tree Expand file tree Collapse file tree
src/ProcessBus.Iec61850.Raw/Runtime Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using ProcessBus . Core . Services ;
2+
3+ namespace ProcessBus . Iec61850 . Raw . Runtime ;
4+
5+ /// <summary>
6+ /// Adapts any analyzer data source, including the live Npcap-backed source, to the
7+ /// immutable runtime publication boundary. This enables staged consumer migration
8+ /// without changing the existing capture contract or introducing a second decoder.
9+ /// </summary>
10+ public sealed class AnalyzerRuntimeSnapshotSource
11+ {
12+ private readonly IAnalyzerDataSource _source ;
13+ private readonly SvRuntimeSnapshotPublisher _publisher = new ( ) ;
14+
15+ public AnalyzerRuntimeSnapshotSource ( IAnalyzerDataSource source )
16+ {
17+ _source = source ?? throw new ArgumentNullException ( nameof ( source ) ) ;
18+ }
19+
20+ public string Name => _source . Name ;
21+ public SvRuntimeSnapshot Latest => _publisher . Latest ;
22+
23+ public async Task < SvRuntimeSnapshot > GetSnapshotAsync ( CancellationToken cancellationToken = default )
24+ {
25+ var analyzerSnapshot = await _source . GetSnapshotAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
26+ cancellationToken . ThrowIfCancellationRequested ( ) ;
27+ return _publisher . Publish ( analyzerSnapshot ) ;
28+ }
29+
30+ public void Reset ( ) => _publisher . Reset ( ) ;
31+ }
You can’t perform that action at this time.
0 commit comments