Current Upgrade Tutorial (Rx)

I am very interested in Reactive Extensions, but I can not find the current tutorial. I started with Denying Asynchronous Blues with Reactive Extensions for .NET , but it's deprecated. I can understand some of the changes, but I could not get many examples to work.

I found many articles on the Internet, mainly from 2009,2010, but they are also incompatible with the current version. I am particularly interested in using Rx with Windows Phone and WebClient:

WebClient wc = new WebClient(); var o = Observable.FromEvent<DownloadStringCompletedEventArgs>(wc, "DownloadStringCompleted").Select(newString => newString.EventArgs.Result); // Subscribe to the observable, and set the label text o.Subscribe(s => myLabel.Text = s); // Start the download wc.DownloadStringAsync(new Uri("http://www.data.com/service")); 

Don't work anymore, and replacing FromEvent with FromEventPattern not enough.

Can someone point me to an updated resource?

+47
c # system.reactive
Apr 04 '12 at 12:45
source share
4 answers

When learning Rx, the first thing you need to understand is the philosophy behind IObservable, and how it focuses on nature is compared to IEnumerable. I suggest the following for a good explanation: Simplified tutorial for reactive extensions [noher]

Lee Campbell has a good series explaining api and when to use them. He is also trying to keep it up to date with the latest releases: Reactive Extensions for.NET a Introduction The series is now available as a book in Introduction to Rx

By the way, I also wrote a blog post about solving a real-life problem using rx: Using reactive extensions to stream data from a database

Hope this helps.

+45
Apr 04 2018-12-12T00:
source share

I found a learn by doing project called Reactive Extensions (Rx) Koans .
It was updated in March 2012, so it is fairly updated.

Definition "Koan Kōans is a Zen word meaning enlightenment or awakening of a person, usually through a riddle or riddle. The most common of them is:" What sound does one hand clap? "

It is made up of a series of nearly complete unit tests that you must complete so that they pass. You do this by filling in the blanks.

It is fairly neat, fairly easy to complete and provides valuable information.

Oh yes, and that was Bart De Smith from the Rx team.

Here's a typical unit test:

 [TestMethod] public void DoingInTheMiddle() { var status = new List<String>(); var daysTillTest = Range.Create(4, 1).ToObservable(); daysTillTest.Do(d => status.Add(d + "=" + (d == 1 ? "Study Like Mad" : ___))) .Subscribe(); Assert.AreEqual("[4=Party, 3=Party, 2=Party, 1=Study Like Mad]", status.AsString()); } 
+18
Mar 07 '13 at 22:15
source share

To date, the best resource that has helped me wrap my head around Rx is: http://www.introtorx.com/

I think this happens to a lot of people, but you cannot find this site when searching for the keywords "Rx tutorial". Think someone needs to add some tags to the site!

+13
Apr 3 '13 at 1:52
source share

Read this online book line by line (each line) and practice. This is good, I did when I started with Rx.

http://www.introtorx.com/

+4
Apr 25 '13 at 1:53 on
source share



All Articles