Beispiel #1
0
        private static void Main(string[] args)
        {
            var uncontextedDataProvider = new UncontextedWebsocketSubscriber("ws://literature.uncontext.com:80");

            var observer = Observer.Create<UncontextedData>(
                onNext: data => Console.WriteLine("OnNext: " + data),
                onError: error => Console.WriteLine("OnError: " + error.Message),
                onCompleted: () => Console.WriteLine("Completed."));

            uncontextedDataProvider.UncontextedData.Subscribe(observer);
            uncontextedDataProvider.ConnectAndStartReceivingToWebSocket();

            Console.WriteLine("Press <Enter> to exit...");
            Console.ReadLine();
        }
 private Subject<UncontextedData> InitializeWebsocket()
 {
     var websocketSubscriber = new UncontextedWebsocketSubscriber("ws://literature.uncontext.com:80");
     websocketSubscriber.ConnectAndStartReceivingToWebSocket();
     return websocketSubscriber.UncontextedData;
 }