示例#1
0
        static void Blocking()
        {
            var observable = new MyBlockingRangeObservable(5, 8);

            var subscription1 = observable.Subscribe(new MyObserver <int>());

            subscription1.Dispose();

            Console.WriteLine();

            var subscription2 = observable.Subscribe(new MyObserver <int>("Subscriber 2"));

            subscription2.Dispose();
        }
示例#2
0
        static void DemoDisposeNeverCalledIfClientForgets()
        {
            var observable = new MyBlockingRangeObservable(5, 8);

            var subscription1 = observable.Subscribe(new MySlowObserver <int>());
        }