refactor: Decouple PubTableBroker from IPublisherCore impl

Reference interface rather than the PublisherCore impl.
This commit is contained in:
John Colvin committed 2025-11-03 16:13:18 -05:00
1 parent 8db5655151
commit f2ace4ae32
3 files changed
+16 -6

No files matched your search

@@ -0,0 +1,8 @@
namespace Bts.DataStreamCore;
using BCG;
public interface IPubTableBroker {
void create_table(IBlueRowCollection table);
void make_batch_changes(IBlueRowCollection new_rows, IBlueRowCollection del_rows, IBlueRowCollection added_rows);
}
@@ -8,12 +8,14 @@ using BCG.Utilities;
using bts;
using Bts.DataStreamCore;
namespace BCG {
/// <summary>
/// This class will be used by the clients to publish tabular data to the pubsub
/// </summary>
public class PubTableBroker {
protected PublisherCore _publisher_core;
public class PubTableBroker : IPubTableBroker {
protected IPublisherCore _publisher_core;
protected IDictionary<string, SinglePubTableBroker> _publisher_map =
new Dictionary<string, SinglePubTableBroker>();
@@ -22,7 +24,7 @@ namespace BCG {
public PubTableBroker()
: this(new PublisherCore()) { }
public PubTableBroker(PublisherCore publisher) {
public PubTableBroker(IPublisherCore publisher) {
_publisher_core = publisher;
Log.Gen.info("PubTableBroker constructed");
}
@@ -14,9 +14,9 @@ namespace BCG {
public class SinglePubTableBroker {
private readonly string _tag;
protected IStreamIOMsgSerializer _serializer;
protected PublisherCore _publisher_core;
protected IPublisherCore _publisher_core;
public SinglePubTableBroker(string tag, PublisherCore publisher_core) {
public SinglePubTableBroker(string tag, IPublisherCore publisher_core) {
bts.Log.Gen.info($"SinglePubTableBroker.cons created for tag: {tag}");
_tag = tag;
_publisher_core = publisher_core;
@@ -51,4 +51,4 @@ namespace BCG {
}
}
}
}