Skip to content

Commit b9fbe18

Browse files
committed
port over enqueue/simple-client
1 parent f48f0d3 commit b9fbe18

16 files changed

Lines changed: 657 additions & 32 deletions

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@
2222
},
2323
"require": {
2424
"php": ">=8.1",
25-
"cakephp/cakephp": "dev-5.next as 5.1.0",
26-
"enqueue/simple-client": "^0.10",
27-
"psr/log": "^3.0"
25+
"cakephp/cakephp": "^5.1.0",
26+
"psr/log": "^3.0",
27+
"enqueue/enqueue": "^0.10",
28+
"queue-interop/amqp-interop": "^0.8.2",
29+
"queue-interop/queue-interop": "^0.8",
30+
"symfony/config": "^5.4|^6.0|^7.0"
2831
},
2932
"require-dev": {
3033
"cakephp/bake": "dev-3.next",

src/Command/RequeueCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function execute(Arguments $args, ConsoleIo $io): void
138138
'config' => $failedJob->config,
139139
'priority' => $failedJob->priority,
140140
'queue' => $failedJob->queue,
141-
]
141+
],
142142
);
143143

144144
$failedJobsTable->deleteOrFail($failedJob);

src/Command/WorkerCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function getOptionParser(): ConsoleOptionParser
110110
'short' => 'a',
111111
]);
112112
$parser->setDescription(
113-
'Runs a queue worker that consumes from the named queue.'
113+
'Runs a queue worker that consumes from the named queue.',
114114
);
115115

116116
return $parser;

src/Consumption/LimitAttemptsExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ public function onResult(MessageResult $context): void
6565

6666
if ($attemptNumber >= $maxAttempts) {
6767
$context->changeResult(
68-
Result::reject(sprintf('The maximum number of %d allowed attempts was reached.', $maxAttempts))
68+
Result::reject(sprintf('The maximum number of %d allowed attempts was reached.', $maxAttempts)),
6969
);
7070

7171
$exception = (string)$message->getProperty('jobException');
7272

7373
$this->dispatchEvent(
7474
'Consumption.LimitAttemptsExtension.failed',
7575
['exception' => $exception, 'logger' => $context->getLogger()],
76-
$jobMessage
76+
$jobMessage,
7777
);
7878

7979
return;
@@ -88,7 +88,7 @@ public function onResult(MessageResult $context): void
8888
$producer->send($consumer->getQueue(), $newMessage);
8989

9090
$context->changeResult(
91-
Result::reject('A copy of the message was sent with an incremented attempt count.')
91+
Result::reject('A copy of the message was sent with an incremented attempt count.'),
9292
);
9393
}
9494
}

src/Consumption/LimitConsumedMessagesExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function shouldBeStopped(LoggerInterface $logger): bool
7979
$logger->debug(sprintf(
8080
'[LimitConsumedMessagesExtension] Message consumption is interrupted since the message limit ' .
8181
'reached. limit: "%s"',
82-
$this->messageLimit
82+
$this->messageLimit,
8383
));
8484

8585
return true;

0 commit comments

Comments
 (0)