Asynchronous Function Call in PHP

前端 未结 7 1515
逝去的感伤
逝去的感伤 2020-11-30 20:54

I am working on an a PHP web application and i need to perform some network operations in the request like fetching someone from remote server based on user\'s request.

7条回答
  •  暖寄归人
    2020-11-30 21:33

    I dont have a direct answer, but you might want to look into these things:

    • Recoil project - https://github.com/recoilphp/recoil
    • php's LibEvent extension? http://www.php.net/manual/en/book.libevent.php
    • process forking http://www.php.net/manual/en/function.pcntl-fork.php
    • message brokers, i.e. you could start workers to make the HTTP calls and once that job is done, insert a new job describing the work that needs to be done in order to process the cached HTTP response body.

提交回复
热议问题