Skip to content

Commit 69cbe85

Browse files
committed
console command to poll actions
1 parent 505872c commit 69cbe85

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
namespace Devsrv\ScheduledAction\Console;
4+
use Devsrv\ScheduledAction\Facades\Action;
5+
6+
use Illuminate\Console\Command;
7+
8+
class PollScheduledAction extends Command
9+
{
10+
/**
11+
* The name and signature of the console command.
12+
*
13+
* @var string
14+
*/
15+
protected $signature = 'scheduledaction:poll
16+
{--tasks=10 : How many tasks on each poll}';
17+
18+
/**
19+
* The console command description.
20+
*
21+
* @var string
22+
*/
23+
protected $description = 'Poll scheduled model actions';
24+
25+
/**
26+
* Create a new command instance.
27+
*
28+
* @return void
29+
*/
30+
public function __construct()
31+
{
32+
parent::__construct();
33+
}
34+
35+
/**
36+
* Execute the console command.
37+
*
38+
* @return int
39+
*/
40+
public function handle()
41+
{
42+
$tasks = $this->option('tasks') ?? 10;
43+
44+
return Action::emit($tasks);
45+
}
46+
}

0 commit comments

Comments
 (0)