35 lines
838 B
C#
35 lines
838 B
C#
using System;
|
|
|
|
using BCG;
|
|
|
|
bts.utils.BTSNativeMethods.provide_command_line(new string[] { }, 0);
|
|
mbts.config.Configuration.initialize();
|
|
|
|
bts.Log.Gen.info($"Starting DSPublisher");
|
|
Console.WriteLine("Starting DSPublisher...");
|
|
// SimpleTCPClient.start("127.0.0.1", 12345);
|
|
// Task.Delay(1000000000).Wait();
|
|
|
|
//TestPubliser.publish();
|
|
//TestPubliser.subscribe();
|
|
// TestPublisher ts = new TestPublisher(false);
|
|
// ts.keep_publishing(TimeSpan.FromSeconds(10));
|
|
|
|
|
|
_subscribe_to_stream();
|
|
|
|
void _subscribe_to_stream() {
|
|
BCG.ViewStream vs = new TableStream("time");
|
|
vs.onChange += on_change;
|
|
}
|
|
|
|
while (true) {
|
|
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(1));
|
|
ViewStreamDatabase.instance.doWork();
|
|
}
|
|
|
|
|
|
void on_change(object obj) {
|
|
DataPacket dp = obj as DataPacket;
|
|
dp.newRows.print_table((col) => { return 10; });
|
|
} |