From a5ef2de3e4ba7b1263df0649591e04af5d76bcc1 Mon Sep 17 00:00:00 2001 From: Joop Schilder Date: Mon, 14 Dec 2020 15:41:14 +0100 Subject: [PATCH] Remove symlink --- src/Context.php | 6 +++--- src/Workers.php | 4 ++-- tests | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) delete mode 120000 tests diff --git a/src/Context.php b/src/Context.php index 4e6823f..e1eb0d0 100644 --- a/src/Context.php +++ b/src/Context.php @@ -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); }); } diff --git a/src/Workers.php b/src/Workers.php index 4687b5e..8910f3d 100644 --- a/src/Workers.php +++ b/src/Workers.php @@ -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]); } diff --git a/tests b/tests deleted file mode 120000 index ea7b62d..0000000 --- a/tests +++ /dev/null @@ -1 +0,0 @@ -src/Tests \ No newline at end of file