continue processing php after sending http response

后端 未结 12 794
旧时难觅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:27

    I asked this question to Rasmus Lerdorf in April 2012, citing these articles:

    • https://www.zulius.com/how-to/close-browser-connection-continue-execution/
    • close a connection early
    • http://php.net/manual/en/features.connection-handling.php

    I suggested the development of a new PHP built-in function to notify the platform that no further output (on stdout?) will be generated (such a function might take care of closing the connection). Rasmus Lerdorf responded:

    See Gearman. You really really don't want your frontend Web servers doing backend processing like this.

    I can see his point, and support his opinion for some applications/ loading scenarios! However, under some other scenarios, the solutions from vcampitelli et al, are good ones.

提交回复
热议问题