非swoole的方式实现简单的异步(nginx模式下)

set_time_limit(0);echo '任务开始'.time();/*即时打印*/register_shutdown_function([$this, "test"]);/*异步执行 test 为类中方法名 */echo '任务结束'.time();/*即时打印*/fastcgi_finis
posted @ 2021-12-02 10:11  龍飛鳯舞  阅读(55)  评论(0编辑  收藏  举报