Home > PHP Framework > Workerman > body text

What should I do if workerman cannot be closed?

藏色散人
Release: 2019-12-18 15:56:51
Original
2686 people have browsed it

What should I do if workerman cannot be closed?

workerman What should I do if I can’t close it?

Problem: Executing Worker::stopAll() in the startup script does not stop workererman. Worker::stopAll() is only effective when executed in the main process running workererman, and has no effect when executed by other external processes. .

The process of stopping Workerman is

1. Find the Workerman main process pid

2. Send the SIGINT signal to the pid (posix_kill(SIGINT, pid) )

3. After the worker main process receives the SIGINT signal, it executes Worker::stopAll() to complete the service stop.

These three steps should be encapsulated inside Workerman. The calling process is

1. Set $argv = 'stop';

2. Run Worker::runAll();

Recommended: workermanTutorial

The above is the detailed content of What should I do if workerman cannot be closed?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!