Skip to content

Commit

Permalink
Smoother parallel process quitting when the child process crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 13, 2021
1 parent 3c56362 commit cbbbd36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Parallel/ParallelAnalyser.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function analyse(
$process = $this->processPool->getProcess($identifier);
$process->bindConnection($decoder, $encoder);
if (count($jobs) === 0) {
$this->processPool->quitProcess($identifier);
$this->processPool->tryQuitProcess($identifier);
return;
}

Expand Down Expand Up @@ -174,7 +174,7 @@ public function analyse(
}

if (count($jobs) === 0) {
$this->processPool->quitProcess($processIdentifier);
$this->processPool->tryQuitProcess($processIdentifier);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Parallel/ProcessPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function tryQuitProcess(string $identifier): void
$this->quitProcess($identifier);
}

public function quitProcess(string $identifier): void
private function quitProcess(string $identifier): void
{
$process = $this->getProcess($identifier);
$process->quit();
Expand Down

0 comments on commit cbbbd36

Please sign in to comment.