Extracted Process Control to separate interface to allow better tests

This commit is contained in:
2020-12-11 13:23:57 +01:00
parent ffebc74a7d
commit 600f52567f
11 changed files with 287 additions and 25 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace Toalett\Multiprocessing\ProcessControl;
class Wait
{
public int $pid;
public int $status;
public function __construct(int $pid, int $status = 0)
{
$this->pid = $pid;
$this->status = $status;
}
public function childStopped(): bool
{
return $this->pid > 0;
}
public function failed(): bool
{
return $this->pid < 0;
}
}