Over a million developers have joined DZone.

Reactive Extensions (Rx) For Event-based Programming

DZone's Guide to

Reactive Extensions (Rx) For Event-based Programming

· ·
Free Resource
One of the nice .NET features I learned recently is called Reactive Extensions. This is a very nice library that allows asynchronous and event-based programs to be used as collections. I found it particularly compelling to learn it as I see more and more code being written in async way and event-driven. However, if you're not so used to this kind of programming, it is hard to wrap your mind around code that makes use of it - and debug and find where issues can be when they arise.

Reactive Extensions moves from a pull-model to a push-model, where instead of having a collection that implements an IEnumerable, you have an IObservable that you subscribe to. Your delegate is then called whenever an event is dispatched by your source. But it's not only that. You can make use of many Linq operators to make your code much simpler.

I'd recommend that you watch the videos on the following page:

Out of these videos, do the workshops and try the challenges. Since they are not ordered on the page above, let me list them in order here:

Finally, another good link is this page with tens of Rx samples:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}