Example #1
0
        public void Should()
        {
            using (var subscriber = new DataPointSubscriber("localhost", 17892))
            {
                subscriber.Start();
                subscriber.DataPointReceived += delegate(object sender, DataPointEventArgs args)
                {
                    Console.WriteLine(args.DataPoint.Value);
                };

                Thread.Sleep(50000);
            }
        }
Example #2
0
        public static Action<StatrContext> IsListening()
        {
            return context =>
            {
                var subscriber = new DataPointSubscriber("localhost", 17892);
                subscriber.Start();

                while (!subscriber.IsSubscribed)
                {
                    Thread.Sleep(10);
                }
                Thread.Sleep(10);

                context.Add(subscriber);
            };
        }