BT

Rx 1.0 Solves the Problem of Asynchronous Data Access

by Abel Avram on Jun 30, 2011 |

Microsoft has released version 1.0 of their Reactive Extensions (Rx) library after two years in incubation. Rx combines event-driven UI with LINQ, concurrency and asynchronous calls.

Rx tries to solve the problem of asynchronously accessing data from an event-based UI. The standard Iterator pattern with its basic interfaces IEnumerable and IEnumerator is not adequate for asynchronous operations, so Rx solved the problem by introducing the Observer pattern, having two main interfaces, IObservable and IObserver. Instead of a client iterating step by step over a data collection, the collection pushes data to the client as a result to an asynchronous call, closing the call’s loop.

This scenario is especially useful in cloud computing, according to Erik Meijer, the leader of the Rx project. Cloud computing involves asynchronous calls due to inherent network latencies, so for a client is much better to ask for data, then continue with other tasks and receive the data when it becomes available. While this problem seems simple to be solved using more standard ways, the power of Rx comes from its embedded support for LINQ and concurrency. So, the user not just gets a piece of data in an asynchronous way, be he can generate asynchronous LINQ queries over collections of data and run them concurrently. Rx deals with concurrency by being built on top of Parallel Extensions (PFX), a managed concurrency library including Parallel LINQ and Task Parallel Library.

After two years being in incubation, Rx has become an official Microsoft product and made its debut as the stable release 1.0 in the Data Developer Center. Developers can program with Rx using C#, VB.NET, C++, F# and JavaScript on all Windows versions since XP and also on Windows Phone 7.

Other resources: Recent InfoQ Interview with Bart De Smet on Reactive Extensions (Rx) for .NET and JavaScript, Rx MSDN Documentation, and Channel 9 Rx Workshop.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT