private IObservable <DictionaryWord[]> LookupAsync(string wordToSearch) { if (Svc == null) { Svc = new DictServiceSoapClient(); } // For testing TakeUntil use .Delay(TimeSpan.FromSeconds(5)) for delay emulating return(Svc.MatchInDictAsync(DictionaryId, wordToSearch, SearchStrategy).ToObservable()); //.Delay(TimeSpan.FromSeconds(5)); }
// While requests for “rea”, “reac”, “react”, “reacti”, “reactiv” and “reactive” are started in that order, results may come back in a different order as shown below: public void ResponseOrderTest() { if (Svc == null) { Svc = new DictServiceSoapClient(); } const string input = "reactive"; for (var len = 3; len <= input.Length; len++) { var req = input.Substring(0, len); LookupAsync(req).Subscribe( words => Console.WriteLine(req + @" --> " + words.Length) ); } }