Skip to content

Commit a7d0801

Browse files
committed
feat: add queue:work command
1 parent e311c1d commit a7d0801

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace Leaf\Queue\Commands;
4+
5+
use Aloe\Command;
6+
7+
class QueueWorkCommand extends Command
8+
{
9+
protected static $defaultName = 'queue:work';
10+
public $description = 'Start your queue worker';
11+
public $help = 'Start your queue worker';
12+
13+
protected function handle()
14+
{
15+
$this->writeln('Queue worker started for queue \'default\'...');
16+
17+
$queueConfig = MvcConfig('queue');
18+
19+
(new \Leaf\Worker())
20+
->queue($queueConfig['connections'][$queueConfig['default']])
21+
->run();
22+
23+
return 0;
24+
}
25+
}

0 commit comments

Comments
 (0)