example of how to use fastcgi_finish_request()

前端 未结 1 521
不思量自难忘°
不思量自难忘° 2020-11-28 07:26

Can someone show a simple example on how to use fastcgi_finish_request() function? I googled but only found some general mention of it, some people say they use

相关标签:
1条回答
  • 2020-11-28 08:02

    I understand that basically I can call fastcgi_finish_request(); and then continue executing PHP script.

    Yes, that's all you have to do.

    $obj = new controller();
    echo $o->getResult();
    fastcgi_finish_request();
    do_facebook_thing();
    

    To convince yourself it is working, do this:

    echo "Test";
    fastcgi_finish_request();
    sleep(10);
    

    If you remove the second line, then you will see that the browser has to wait 10 seconds.

    0 讨论(0)
提交回复
热议问题