Wednesday, March 21, 2012

Need help with implementing a pattern for asynchronous requests/responses in a loop

Here is the pseduo code for what I need to do:

Get URL
For each element in XML file (currently 8)
Extract URL
Get URL
For each element in XML file2 (between 1 and 8)
Extract URL
Get URL
For each element in XML file3 (between 1 and 10)
process elements
Loop
Loop
Loop

I could easily do this using synchronous xmlhttp calls, but I am also trying my best to avoid that. The problem is that I can't think of a clean way to do this using asynchronous calls. Can any one assist with a pattern that would do this?

Cheers,

Scott

P.S. This needs to be done on the client as I am not willing to use my own server here. Although, I have considered something like Yahoo! Pipes or Microsoft's PopFly to mash this information up for me.

Hi,

Thank you for your post!

As far as I know, there is no built-in support for this usage in MS AJAX 1.0/3.5.

I think the most flexible way to do it is to use directly synchronous xmlhttp calls.

If you have further questions,let me know.

Best Regards,

No comments:

Post a Comment