Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an equivalent of the Task.ContinueWith operator in Rx?

Is there an equivalent of the Task.ContinueWith operator in Rx?

I'm using Rx with Silverlight, I am making two webservice calls with the FromAsyncPattern method, and I'd like to do them synchronously.

        var o1 = Observable.FromAsyncPattern<int, string>(client.BeginGetData, client.EndGetData);
        var o2 = Observable.FromAsyncPattern<int, string>(client.BeginGetData, client.EndGetData);

Is there an operator (like Zip) that will only start / subscribe to o2 only after o1 returns Completed?
I handle failure of either web service call the same way.

like image 595
foson Avatar asked Dec 12 '22 11:12

foson


1 Answers

Yes, it's called projection:

o1().SelectMany(_ => o2()).Subscribe();
like image 73
Alex Zhevzhik Avatar answered Mar 15 '23 23:03

Alex Zhevzhik