Skip to content

Commit 7a95abd

Browse files
Final commit
1 parent f0624c6 commit 7a95abd

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

src/app/Account/Application/Register/RegisterHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ final class RegisterHandler extends Handler
1616
public function handle(RegisterCommand $command): bool
1717
{
1818
try {
19-
RegisterJob::dispatch($command);
19+
RegisterQueue::dispatch($command);
2020

2121
return true;
2222
}

src/app/Account/Application/Register/RegisterJob.php renamed to src/app/Account/Application/Register/RegisterQueue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
namespace App\Account\Application\Register;
44

5-
use App\Shared\Application\Job\Job;
5+
use App\Shared\Application\Queue\Queue;
66
use App\Shared\Domain\Slug\RoleSlug;
77
use App\Account\Domain\User;
88
use App\Account\Domain\Repository\RoleRepositoryInterface;
99
use App\Account\Domain\Repository\UserRepositoryInterface;
1010
use App\Account\Domain\Email\Email;
1111
use App\Account\Domain\Password\Password;
1212

13-
final class RegisterJob extends Job
13+
final class RegisterQueue extends Queue
1414
{
1515
/**
1616
* Create a new registration job instance.

src/app/Shared/Application/Job/JobChain.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/app/Shared/Application/Job/Job.php renamed to src/app/Shared/Application/Queue/Queue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php declare(strict_types=1);
22

3-
namespace App\Shared\Application\Job;
3+
namespace App\Shared\Application\Queue;
44

55
use Illuminate\Contracts\Queue\ShouldQueue;
66
use Illuminate\Foundation\Queue\Queueable;
77

8-
abstract class Job implements ShouldQueue
8+
abstract class Queue implements ShouldQueue
99
{
1010
/**
1111
* A queued job for asynchronous processing.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace App\Shared\Application\Queue;
4+
5+
use Illuminate\Support\Facades\Bus;
6+
7+
abstract class QueueChain
8+
{
9+
/**
10+
* Array of queues to run in sequence.
11+
*
12+
* @var array<int, object|string|callable>
13+
*/
14+
protected array $queues = [];
15+
16+
/**
17+
* Run the chain of podcast queues.
18+
*
19+
* @return mixed
20+
*/
21+
public function run(): mixed
22+
{
23+
return Bus::chain($this->queues)->dispatch();
24+
}
25+
}

0 commit comments

Comments
 (0)