Вебхуки: подписки, подпись посылок и доставка очередью
Общий HTTP-клиент с настройкой CA-бандла, на него же переведён драйвер mailer. Воркер умеет несколько очередей: worker --queue=default,webhooks.
This commit is contained in:
1 parent
3f64f4a49a
commit
fce276bb13
17 files changed
+1537
-77
No files matched your search
@@ -7,6 +7,7 @@ namespace Rsgrinko\Proton\Console\Commands;
|
||||
use Rsgrinko\Proton\Console\Command;
|
||||
use Rsgrinko\Proton\Queue\Queue;
|
||||
use Rsgrinko\Proton\Queue\Worker;
|
||||
use Rsgrinko\Proton\Webhooks\Webhooks;
|
||||
|
||||
/**
|
||||
* воркер очереди.
|
||||
@@ -25,12 +26,14 @@ final class WorkerCommand extends Command
|
||||
|
||||
public function usage(): string
|
||||
{
|
||||
return 'worker [--once] [--queue=default]';
|
||||
return 'worker [--once] [--queue=default,webhooks]';
|
||||
}
|
||||
|
||||
public function run(): int
|
||||
{
|
||||
$queue = (string) $this->option('queue', Queue::DEFAULT_QUEUE);
|
||||
// Очередей можно перечислить несколько через запятую: задача из очереди
|
||||
// слева берётся раньше
|
||||
$queue = (string) $this->option('queue', Queue::DEFAULT_QUEUE . ',' . Webhooks::queue());
|
||||
$result = (new Worker($queue))->run($this->hasOption('once'));
|
||||
|
||||
$this->line('Выполнено: ' . $result['done'] . ', с ошибкой: ' . $result['failed']);
|
||||
|
||||
Reference in new issue
Block a user