Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: recive ctrl+c signal kill child process #15

Merged
merged 1 commit into from
Mar 23, 2020

Conversation

alberthuang24
Copy link
Contributor

If the abnormal main process exits abnormally before the repair, the child process will remain.

$wp=new \QXS\WorkerPool\WorkerPool();
            $wp->setWorkerPoolSize(8)
               ->create(new \QXS\WorkerPool\ClosureWorker(
                function($input, $semaphore, $storage) {
                    usleep(5000);
                    echo $input;
                }
                }
));

for ($i = 0; $i < 20; $i ++) {
$wp->run($i);
}

$wp->waitForAllWorkers();
$wp->destroy();

run php ./test.php and ctrl+c keydown;

@qxsch
Copy link
Owner

qxsch commented Mar 23, 2020

Thanks a lot for your contribution

@qxsch qxsch merged commit 50b1d3b into qxsch:master Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants