Welcome Guest, Not a member yet? Register   Sign In
How multithread my request to a slow API URL in CI?
#3

[eluser]Unknown[/eluser]
Thanks.
My code has been confirmed as <b><i>not</i></b> contributing to the slowdown.

The problem I'm trying to address right now is <b><i>not</i></b> the slow response itself, but rather the best way to submit simultaneous requests to his webservice API <i>and</i> be able to capture the results in a way that allows me to process what gets returned.

The approach that I <b><i>expect</i></b> to take is to loop through the list of products, start a thread on each loop by submitting a request to his API, and move on to the next iteration of the loop to start yet another thread.

My goal is to submit as many request as quickly as I can, process all the responses I receive and separate them all into two list; a list of items which returned results, and a list of items which did not.
From there I'll process what results I did get, and submit the others to a different asset so they can be researched.

How can this be done?

NOTE: I initially thought I'd need to track each response to it's appropriate request, but I'm beginning to realize that, since the response might have the search term in it, I <b><i>MIGHT</i></b> be able to just catch and process the responses without knowing/caring which request it's for ... but I'll have to verify that before I can say definitively.


Messages In This Thread
How multithread my request to a slow API URL in CI? - by El Forum - 09-07-2012, 01:02 PM
How multithread my request to a slow API URL in CI? - by El Forum - 09-07-2012, 02:00 PM
How multithread my request to a slow API URL in CI? - by El Forum - 09-07-2012, 02:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB