PHP+fork(): How to run a fork in a PHP code

前端 未结 3 1320
無奈伤痛
無奈伤痛 2021-02-04 19:41

I am running my code on CodeIgniter - Ubuntu Server.

I have been researching for async ways to run functions.

This is my function:



        
3条回答
  •  天命终不由人
    2021-02-04 20:19

    You have one fork after your pcntl_fork(), check $pid and then you can use it. Repeat for more forks.

    
    

    For async http requests you can use multicurl: http://php.net/manual/en/function.curl-multi-init.php

提交回复
热议问题