chore: complete update
This commit is contained in:
29
src/Framework/Queue/QueueInitializer.php
Normal file
29
src/Framework/Queue/QueueInitializer.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Framework\Queue;
|
||||
|
||||
use App\Framework\Core\PathProvider;
|
||||
use App\Framework\DI\Initializer;
|
||||
|
||||
final readonly class QueueInitializer
|
||||
{
|
||||
public function __construct(
|
||||
private PathProvider $pathProvider
|
||||
)
|
||||
{
|
||||
}
|
||||
#[Initializer]
|
||||
public function __invoke(): Queue
|
||||
{
|
||||
$queue = new RedisQueue(
|
||||
queueName: 'commands',
|
||||
host: 'redis',
|
||||
port: 6379,
|
||||
|
||||
);
|
||||
|
||||
$path = $this->pathProvider->resolvePath('/src/Framework/CommandBus/storage/queue/');
|
||||
|
||||
return new FileQueue($path);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user