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

@@ -29,7 +29,7 @@ class Context implements EventEmitterInterface
$this->workers->on('worker_started', fn(int $pid) => $this->emit('worker_started', [$pid]));
$this->workers->on('worker_stopped', fn(int $pid) => $this->emit('worker_stopped', [$pid]));
$this->workers->on('worker_stopped', fn() => $this->emitIf($this->workers->empty(), 'no_workers_remaining'));
$this->workers->on('worker_stopped', fn() => $this->emitIf(empty($this->workers), 'no_workers_remaining'));
}
public function submit(callable $task, ...$args): void