refactor: Decouple ViewPublisher from IPubTableBroker impl

This commit is contained in:
John Colvin committed 2025-07-23 15:47:39 -04:00
1 parent 850d6a1ce4
commit 2b7fa477fb
1 file changed
+4 -2
@@ -4,10 +4,12 @@ using System.Data;
using BCG.Utilities;
using Bts.DataStreamCore;
namespace BCG {
public class ViewPublisher : IDisposable {
protected ViewPublisher() { }
private readonly PubTableBroker _broker;
private readonly IPubTableBroker _broker;
protected readonly ViewStream _stream;
private int _n_updates = 0;
@@ -15,7 +17,7 @@ namespace BCG {
/// in the schema (be careful with that because this
/// could lead to double publishes if the schema name
/// is not uniquely chosen)
public ViewPublisher(string name, PubTableBroker broker, ViewStream vs) {
public ViewPublisher(string name, IPubTableBroker broker, ViewStream vs) {
_stream = String.IsNullOrEmpty(name) ? vs : new ChangeTableNameStream(vs, name);
_broker = broker;
_stream.onChange += _handle_update;