In my last video, I discussed Events and Delegates in .NET. Whenever we implement the Event/Delegate combination, we use an observer pattern.
Hence Reactive extension is the natural progression in terms of the next step for implementing Observer patterns. Reactive Extension is a combination of Observer pattern with iterator pattern. The main interface used in Reactive extension is IObservable, which is also known as dual of IEnumerable. Meaning IEnumerable deals with a pull for data in rest, whereas IObservable deals with the push of data or data in motion.
Using Reactive extension we can easily create event streams, compose and transform the stream of events with a similar pattern as LINQ. Anywhere we can use an observable pattern we can use Rx.
The two main interfaces which are building blocks of Rx are IObservable and IObserver. However, we are going to use ISubject, which significantly simplifies the implementation.
Source code for this video is available in my GitHub repo here: github.com/choudhurynirjhar/r...
20 фев 2021