Run PHP Task Asynchronously

后端 未结 15 1331
青春惊慌失措
青春惊慌失措 2020-11-22 15:15

I work on a somewhat large web application, and the backend is mostly in PHP. There are several places in the code where I need to complete some task, but I don\'t want to m

15条回答
  •  猫巷女王i
    2020-11-22 15:26

    PHP HAS multithreading, its just not enabled by default, there is an extension called pthreads which does exactly that. You'll need php compiled with ZTS though. (Thread Safe) Links:

    Examples

    Another tutorial

    pthreads PECL Extension

提交回复
热议问题