Skip to content

Commit 7219be4

Browse files
authored
refactor(async-queue): rename getQueueName to getPoolName for consistency (#7625)
1 parent f94bfd8 commit 7219be4

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Functions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
use Hyperf\AsyncQueue\Driver\DriverFactory;
1616
use Hyperf\Context\ApplicationContext;
1717

18-
function dispatch(JobInterface $job, ?int $delay = null, ?int $maxAttempts = null, ?string $queue = null): bool
18+
function dispatch(JobInterface $job, ?int $delay = null, ?int $maxAttempts = null, ?string $pool = null): bool
1919
{
2020
if (is_int($maxAttempts)) {
2121
$job->setMaxAttempts($maxAttempts);
2222
}
2323

24-
$queue ??= $job->getQueueName();
24+
$pool ??= $job->getPoolName();
2525

2626
return ApplicationContext::getContainer()
2727
->get(DriverFactory::class)
28-
->get($queue)
28+
->get($pool)
2929
->push($job, $delay ?? 0);
3030
}

src/Job.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function compress(): static
5858
return $this;
5959
}
6060

61-
public function getQueueName(): string
61+
public function getPoolName(): string
6262
{
6363
return 'default';
6464
}

src/JobInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ public function setMaxAttempts(int $maxAttempts): static;
2828

2929
public function getMaxAttempts(): int;
3030

31-
public function getQueueName(): string;
31+
public function getPoolName(): string;
3232
}

0 commit comments

Comments
 (0)