webman: 在代码中退出应用

一,文档

地址

https://www.workerman.net/q/14237

二,子进程退出:

代码:

Worker::stopAll();

例子:

    public function list(Request $request)
    {
        Worker::stopAll();
        $where = [];
        $urlParams = [];

三,主进程退出

用php的api杀掉主进程即可

posix_kill(posix_getppid(), SIGINT);

例子:

    public function list(Request $request)
    {
        //Worker::stopAll();

        posix_kill(posix_getppid(), SIGINT);
        
        $where = [];
        $urlParams = [];

 

posted @ 2025-07-19 07:39  刘宏缔的架构森林  阅读(11)  评论(0)    收藏  举报