system.reactive - RIA Services matching a response to the request -


I was thinking that someone might give some advice on the following problem. We are currently RIA Developing a Silverlight 4 app based on Net Services. One screen in the application allows users to type in a search string and after 2 seconds of inactivity, the request is submitted to our domain service. It handles it well with all Rx.

Now it is possible to perform a second search before returning the original. It is also possible to return the second request beforehand.

Actually I am trying to figure out what people are using patterns and approaches to manage the correct answer to the right request.

Are you using any type of operation identifier in your requests? Are you making new examples of your domain services for each request?

Dave

To solve this problem, it should be very easy for you.

If I think you have a sample of the string that has started the search and you have a domain service that gives a result object when the string is given You have the necessary code:

  IObservable & lt; String & gt; SearchText = ...; Function & lt; String, IObservable & lt; Results & gt; & Gt; SearchRequest = Fair Frame Asyncartan & lt; String, Results & gt; (Search Basic Invoak, Search and Invoke); IObservable & LT; Results & gt; Result = (Request search text from cents in search (CT)). Switch ();   

The magic switch is in the extension method, which is IObservable & lt; IObservable & lt; Results & gt; & Gt; - Yes, this is a nested picture.

When a new searchText arrives, a new IObservable & lt; Results & gt; has been created inward search text switch then switches results to use this latest sample and ignores any prefabricated observation.

Therefore the result is that only the latest search results have been seen and any previous results are ignored.

Hope this makes sense. : -)


Comments