PHP API acess multiple calls -
i running calls onto paypal's transactionsearch api through php curl.
unfortunately, api slow respond, taking anywhere 30 seconds more 5 minutes (depending on number of records returned api) single customer.
at moment, script running off cron job, , looping through each customer 1 one. however, if number of customers scale up, entire process take long time (few hours) complete. not enough.
essentially, need run (and process) multiple api calls simultaneously. what's best way achieve this?
since bottleneck remote server, suggest using curl_multi_exec. you'll processing big number of http connections @ once , process results in 1 thread.
this not fastest solution, process responses they're available in multiple threads, approach can make processing 50+ times faster without significant changes.
Comments
Post a Comment