continue processing php after sending http response

后端 未结 12 1062
旧时难觅i
旧时难觅i 2020-11-22 13:06

My script is called by server. From server I\'ll receive ID_OF_MESSAGE and TEXT_OF_MESSAGE.

In my script I\'ll handle incoming text and ge

12条回答
  •  耶瑟儿~
    2020-11-22 13:17

    I know it's an old one, but possibly usefull at this point.

    With this answer i don't support the actual question but how to solve this problem correctly. Hope it helps other people to solve problems like this.

    I would suggest to use RabbitMQ or similar services and run the background workload using worker instances. There is a package called amqplib for php which does all the work for you to use RabbitMQ.

    Pro's:

    1. It's high performant
    2. Nicly structured and maintainable
    3. It's absolutly scalable with worker instances

    Neg's:

    1. RabbitMQ must be installed on the server, this can be a problem with some web hoster.

提交回复
热议问题