Twitter with Rx

This entry is part 4 of 4 in the series Reactive Extensions in theory and practice

In this post we will look at another sample program to get to know a few more Rx operators. We will also see how Rx is great for dealing with user interactions combined with asynchronous data streams.
Continue reading Twitter with Rx

Drawing lines with Rx

This entry is part 3 of 4 in the series Reactive Extensions in theory and practice

In part 1 and 2 of the series Reactive Extensions in theory and practice we covered some of the theory of Rx and introduced a nice visualization method with marble diagrams.

In this post we will have a closer look at the operators Select, Zip and Skip and review a sample application where those operators are extremely useful.

The application is a very simple WPF application where you can draw lines in a window. For each line the distance will be displayed. In fact the code for this program is so simple and declarative that it really shows the shining beauty and elegancy of Rx.

alt text

Continue reading Drawing lines with Rx

Visualizing sequences

This entry is part 2 of 4 in the series Reactive Extensions in theory and practice

As we already know from part 1 an Observable is a sequence of ongoing events in time. These sequences and their compositions and transformations can be nicely visualized by marble diagrams in either textual or graphical representation. The visualization of Observables makes it very easy to understand what is going on even if you are not an expert in Reactive Extensions.
Continue reading Visualizing sequences

Short introduction to Reactive Extensions

This entry is part 1 of 4 in the series Reactive Extensions in theory and practice

The Reactive Extensions (Rx) is a library for programming with asynchronous data streams. It was originally developed at Microsoft for the .NET Framework but is now available as a seperate library. Meanwhile it has been ported to many other languages and platforms as e.g. Java, Scala, C++, Clojure, JavaScript, Python, Groovy, JRuby, and others.

Rx can be used in desktop as well as web-based applications on either server or client side. A few common situations / problems where you might benefit from using Rx are:

  • Unresponsive UI
  • Long running computations that could potentially block other threads
  • Asynchronous programming where multiple sources of data and events have to be combined
  • Enabling and managing concurrency on backend independent of the consumers implementation
  • Handling errors and cancellation of asynchronous tasks

In this post I will introduce some general ideas behind Rx and show how it can help in some of the situations stated above. If you are new to Rx it will give you a basic understanding of what Rx is and where it can be useful to apply.
Continue reading Short introduction to Reactive Extensions