2

I have a list of URIs and while iterating over that list I send OData GET requests via OData.read().

My problem is that those calls are asynchronous and I want them to be synchronous. Is there any way to accomplish that?

As far as I know the given parameters of OData.read() won't allow this. But maybe there is some kind of work-around?

keinabel
  • 1,002
  • 3
  • 15
  • 33
  • Issuing the requests means network traffic, which will be slow and can only be done asynchronously in the browser. Also, synchronously blocking the jscript thread usually means that you block the entire browser UI, which is a very bad user experience. Why do you need the calls to be synchronous? – Vitek Karas MSFT Jul 20 '12 at 09:16
  • This will be a testing application. It would be better too see the results of the request in the same order as the URIs were in their list. – keinabel Jul 20 '12 at 09:22

1 Answers1

0

I solved the problem by using a recursive function, triggering the next ajax request exactly then, when the response of the previous is received.

keinabel
  • 1,002
  • 3
  • 15
  • 33