Remove symlink

This commit is contained in:
Joop Schilder 2020-12-14 15:41:14 +01:00
parent f2f3e9de88
commit a5ef2de3e4
3 changed files with 5 additions and 6 deletions

View File

@ -42,15 +42,15 @@ class Context implements EventEmitterInterface
$this->eventLoop->run();
}
public function submit(callable $task, ...$args): void
public function submit(callable $job, ...$args): void
{
$this->eventLoop->futureTick(function () use ($task, $args) {
$this->eventLoop->futureTick(function () use ($job, $args) {
if ($this->concurrency->isReachedBy(count($this->workers))) {
$this->emit('congestion');
$this->workers->awaitCongestionRelief();
$this->emit('congestion_relieved');
}
$this->workers->createWorkerFor($task, $args);
$this->workers->createWorkerFor($job, $args);
});
}

View File

@ -29,9 +29,9 @@ class Workers implements Countable, EventEmitterInterface
return count($this->workers);
}
public function createWorkerFor(callable $task, array $args = []): void
public function createWorkerFor(callable $job, array $args = []): void
{
$pid = $this->forkWorker($task, $args);
$pid = $this->forkWorker($job, $args);
$this->workers[$pid] = $pid;
$this->emit('worker_started', [$pid]);
}

1
tests
View File

@ -1 +0,0 @@
src/Tests