in reply to Re: Do I need to use Coro instead of threads/forks
in thread Do I need to use Coro instead of threads/forks
Thanks for your help corion
I am using SOAP::Lite to make calls to vendor api's which is internally using LWP.
I tried to override that but maybe done something wrong, if use Coro::LWP will it over ride that behavior, i went looking into source of LWP and it requires LWP::Useragent and stuff.
Your other suggestion, if i understand correctly is to fetch data store it in DB or files and read from there to serve as json.
The example that i gave of product data.
Basically this script is used to search inventory based on user search and results must be fetched from api's directly every time by my script add some of our data and return to user.
As this is inventory like that of airline seats,hotel rooms etc which is frequently changing. I cannot make cache of this information (cache misses are higher than cache hits used CHI driver BerkeleyDB) further the search combinations could be huge to fetch and write to data.
Biggest problem is main threads must wait till all threads return data, hence cannot use detach, detached thread writes data to file/db, main thread polls for write etc.
Any other approach i can follow?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Do I need to use Coro instead of threads/forks
by BrowserUk (Patriarch) on Sep 29, 2014 at 13:13 UTC | |
by mohan2monks (Beadle) on Sep 29, 2014 at 13:27 UTC | |
by BrowserUk (Patriarch) on Sep 29, 2014 at 13:41 UTC | |
by mohan2monks (Beadle) on Sep 30, 2014 at 11:42 UTC | |
by BrowserUk (Patriarch) on Sep 30, 2014 at 13:13 UTC | |
| |
|
Re^3: Do I need to use Coro instead of threads/forks
by Corion (Patriarch) on Sep 29, 2014 at 12:59 UTC | |
by mohan2monks (Beadle) on Sep 29, 2014 at 13:14 UTC | |
by Corion (Patriarch) on Sep 29, 2014 at 13:21 UTC |