Welcome to my series introducing Reactive Extensions to .NET (Rx). This series is aimed at any .NET developer curious about the IObservable and IObserver interfaces that have popped up in .NET 4. However Rx is a library so,
- In the way that it tackles the Observer pattern is bold
- In the way it tackles concurrency is quite a shift from how I have done it before.
- The number of (extension) methods is huge.
- The way in which it integrates with LINQ to leverage LINQ’s composability & declarative style
- The fact that any .NET developer should care. UI developer, backend algorithm coder or integrator; It helps all of us.
- The future plans are even more grand, but that is a different series all together 🙂
In this series I will introduce you to:
- the new types the Rx will provide
- the extension methods and how to use them
- how to manage subscriptions to “streams” of data
- how to deal with concurrency to your advantage and avoid the common old pitfalls
- how to compose, aggregate and transform streams
- how to build workflows with Rx
- some tips and tricks I have picked while using Rx over the past months.
So download the assemblies to reference, fire up Visual Studio and let’s get started:
- Part 1 – Introduction to Rx
- Part 2 – Static and extension methods
- Part 3 – Lifetime management – Completing and Unsubscribing
- Part 4 – Flow control
- Part 5 – Combining multiple IObservable streams
- Part 6 – Scheduling and threading
- Part 7 – Hot and Cold observables
- Part 8 – Testing Rx
- Part 9 – Join, Window, Buffer and Group Join
The full source code is now available either via SVN at http://code.google.com/p/rx-samples/source/checkout or as a zip file.
Edit – This series of posts was first created in mid 2010. The Rx framework has gone through numerous changes during and after the writing of these posts. I am constantly making an effort to ensure that the blog stays as current as I can make it –Lee Campbell