1

I have a table which contain 1lack records, so i need to send all the records to api with in 5 seconds and the api accept only 10 record per request. and no problem i can increase time range from 5 to 25seconds.

So how can i make concurrent 10 request?

Example

100k records
$records_array // accepting 10 records per connection.
function sendCamp($records_array){
    connectionToServer();
    for($i = 0; $i<recordslength; $i++){
          callSMS($records_array[$i]);  
    }
}
5
  • Impossible to decypher question. Commented Aug 18, 2011 at 21:41
  • I need php logic, to split and then send the table records. Commented Aug 18, 2011 at 21:44
  • one of the php loop functions? can you show some code? Commented Aug 18, 2011 at 21:46
  • "1lack" is probably "1 lakh" = 100,000. Indian numbering system. Commented Aug 18, 2011 at 22:14
  • Not indain, asian numbering system. Commented Aug 21, 2011 at 15:45

1 Answer 1

1

You can split records into groups of 10 and then use curl_multi_exec to send them in parallel. That should considerably decrease execution time.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.