PHP cURL multi_exec delay between requests

后端 未结 4 1424

If I run a standard cURL_multi_exec function (example below), I get all cURL handles requested at once. I would like to put a delay of 100ms between each request, is there a

4条回答
  •  耶瑟儿~
    2021-01-19 06:17

    PHP is not solution for that. Forking the script won't help too. In the beginnings yes but once you have a little bit more websites you need to grab like that you will find yourself as your sever very, very red. In terms of costs and in terms of script stability you should reconsider using some other idea.

    You can do that with Python easily and in case of non-blocking real time calls to API endpoints you should use stuff like Socket.IO + Node.JS or just Node.JS or well, huh... lol

    In case that you do not have time nor will you can use stuff like this:

    http://framework.zend.com/manual/en/zendx.console.process.unix.overview.html

    It actually all depends on what are you trying to achieve.

提交回复
热议问题