From 4e6d1a23354581f97a36994c7ca579eb3a511cfd Mon Sep 17 00:00:00 2001 From: John Colvin Date: Thu, 11 Jul 2024 10:05:50 -0400 Subject: [PATCH] refactor: Decouple ManagedSubscriber from ISubscriberCore impl --- .../Client/SubscriptionUtilities/ManagedSubscriber.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/DataStreamSuite/PubSub/Client/SubscriptionUtilities/ManagedSubscriber.cs b/src/DataStreamSuite/PubSub/Client/SubscriptionUtilities/ManagedSubscriber.cs index 0c160ecbd..3c36507d3 100644 --- a/src/DataStreamSuite/PubSub/Client/SubscriptionUtilities/ManagedSubscriber.cs +++ b/src/DataStreamSuite/PubSub/Client/SubscriptionUtilities/ManagedSubscriber.cs @@ -5,6 +5,7 @@ using System.Linq; using BCG.Utilities.General; +using Bts.PubSub; using OnData = System.Action; @@ -18,7 +19,7 @@ namespace BCG { /// public class ManagedSubscriber : IWorker, IDisposable { private static ManagedSubscriber? _self; - private SubscriberCore _subcore; + private ISubscriberCore _subcore; // private IDictionary myTypedDispatchTable = new Hashtable(), // myRawDispatchTable = new Hashtable(); private Dictionary> _dispatch_table = new Dictionary>(); @@ -26,7 +27,7 @@ namespace BCG { public ManagedSubscriber() : this(new SubscriberCore()) { } - public ManagedSubscriber(SubscriberCore subsCore) { _subcore = subsCore; } + public ManagedSubscriber(ISubscriberCore subsCore) { _subcore = subsCore; } public void doWork() { var msg_map = new Dictionary>(); @@ -82,6 +83,9 @@ namespace BCG { } } + void IManagedSubscriber.Subscribe(string tag, OnData onData) => + subscribe(tag, onData); + private void _fire_events(IEnumerable updates) { // TODO foreach (var u in updates) {