jeudi 27 août 2015

Multi Curl Libary or Package Laravel 5

I'm working on a module. What it does is, I have a database with list of UK Numbers on it basically the table structure is:

phones
->id
->number
->network (NULL)
->status (NULL)
->remarks (NULL)

So basically only id and number has a value for now. I have a button on module which when you clicked will fetch all the phone numbers on the database, I currently have hundred thousand records, and I have a loop which will get the number and send an API Request to other tool, that tool will validate the number and return it's network, status and remarks then I will update those NULL values for that particular number. It works well but my problem now is I have hundred thousand records. My current setup will fetch all the numbers, loop thru them, make api request for each then update the record. Problem is before the loop moves to the next item it has to wait for the API Request to respond which takes time, what I want is to make a batch API Request, something like 10 API Request at each loop coz the API Tool told me that they can handle 20 request per second.

Is there a good plugin for that which works perfect for Laravel? I've tried

http://ift.tt/1soXLXb

But doesn't works fine, when it sends request it just loads plus I'm having problems with its parameter for it's startRequest() function. Can you recommend something? Or can I make my own? But I dunno where to start.

Thanks



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1PzSnZ7
via IFTTT

Aucun commentaire:

Enregistrer un commentaire