static void Main(string[] args) { var observable = new MyRangeObservable(5, 8); var subscription = observable.Subscribe(); Console.WriteLine("Press any key to exit the program..."); Console.ReadKey(); }
static void Demo() { var observable = new MyRangeObservable(5, 8); var observer = new MyObserver <int>(); var subscription = observable.Subscribe(observer); Console.WriteLine("Press any key to dispose the subscription"); Console.ReadKey(); subscription.Dispose(); }