File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -37,15 +37,7 @@ final class ConsumeCommand extends WorkCommand
37
37
38
38
public function handle (): int |null
39
39
{
40
- $ consumer = $ this ->worker ;
41
40
$ numProcesses = $ this ->option ('num-processes ' );
42
-
43
- $ consumer ->setContainer ($ this ->laravel );
44
- $ consumer ->setName ($ this ->option ('name ' ));
45
- $ consumer ->setConsumerTag ($ this ->consumerTag ());
46
- $ consumer ->setMaxPriority ((int ) $ this ->option ('max-priority ' ));
47
- $ consumer ->setPrefetchSize ((int ) $ this ->option ('prefetch-size ' ));
48
- $ consumer ->setPrefetchCount ((int ) $ this ->option ('prefetch-count ' ));
49
41
50
42
for ($ i = 0 ; $ i < $ numProcesses ; $ i ++) {
51
43
$ pid = pcntl_fork ();
@@ -69,6 +61,21 @@ public function handle(): int|null
69
61
return 0 ;;
70
62
}
71
63
64
+
65
+ private function consume (): void
66
+ {
67
+ $ consumer = $ this ->worker ;
68
+
69
+ $ consumer ->setContainer ($ this ->laravel );
70
+ $ consumer ->setName ($ this ->option ('name ' ));
71
+ $ consumer ->setConsumerTag ($ this ->consumerTag ());
72
+ $ consumer ->setMaxPriority ((int ) $ this ->option ('max-priority ' ));
73
+ $ consumer ->setPrefetchSize ((int ) $ this ->option ('prefetch-size ' ));
74
+ $ consumer ->setPrefetchCount ((int ) $ this ->option ('prefetch-count ' ));
75
+
76
+ parent ::handle ();
77
+ }
78
+
72
79
private function consumerTag (): string
73
80
{
74
81
if ($ consumerTag = $ this ->option ('consumer-tag ' )) {
You can’t perform that action at this time.
0 commit comments