refactor: Load IDataStreamFactory(s) with dependency injection

So we can create ViewStreams that depend on other services, config, etc.
Previously, the PrimitiveManager relied purely on static construction of
types through reflection.
This commit is contained in:
John Colvin committed 2025-11-14 14:52:07 -05:00
1 parent f65b6b82f2
commit ada7d4bed1
64 files changed
+2399 -147

No files matched your search

@@ -3,6 +3,7 @@ using BCG;
using bts;
using bts.api.core;
using Bts.DataStreamCore;
using Bts.DataStreamQueryAnalyzer;
using Bts.PubSub;
@@ -27,7 +28,14 @@ static class Program {
PubSubConfig.SetGlobalConfig(Log.notnull(cfg.PubSub));
await Configuration.InitializeAsync(cfg.Sparkd);
Log.Gen.info("Starting DataStreamQueryAnalyzer");
var mainForm = new MainForm();
var primitiveManager = new PrimitiveManager(
new PrimitiveManagerConfig() {
Assemblies = new() {
"DataStream.dll",
"SharedStreams.dll"
},
});
var mainForm = new MainForm(primitiveManager);
if (cfg.StreamFile is not null) {
mainForm.loadFile(cfg.StreamFile);
}