Example #1
0
        private static void runQuery(CepStream <StockQuote> cepStream)
        {
            var observer = new Observer();

            // Create waithandle to signal when query is finished
            var adapterStopSignal = new EventWaitHandle(false, EventResetMode.AutoReset, "StockInsightSignal");

            // This starts the query
            var disposable = cepStream.ToObservable <StockQuote>().Subscribe(observer);

            // Wait for query to finish
            adapterStopSignal.WaitOne();

            // Write a blank line
            Console.WriteLine();

            // This line has been commented out because it hangs sometimes
            disposable.Dispose();
        }
Example #2
0
        private static void runQuery(CepStream<StockQuote> cepStream)
        {
            var observer = new Observer();

            // Create waithandle to signal when query is finished
            var adapterStopSignal = new EventWaitHandle(false, EventResetMode.AutoReset, "StockInsightSignal");

            // This starts the query
            var disposable = cepStream.ToObservable<StockQuote>().Subscribe(observer);

            // Wait for query to finish
            adapterStopSignal.WaitOne();

            // Write a blank line
            Console.WriteLine();

            // This line has been commented out because it hangs sometimes
            disposable.Dispose();
        }