How can you limit the simultaneous threads when using Curl with PHP?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s nothing built in that you can use, but you could store a count of how many currently active sessions you have. Once you open a curl session, you increase the count, and when you receive the response and close the session, you decrease the count.
You can store the count in a file, for example. Just open the file, read the count, increase it or decrease it, then save it again in the file.