From 893f9fe7646f8c96883336e28468118c914424d9 Mon Sep 17 00:00:00 2001 From: ALTELMA Date: Mon, 23 Dec 2024 11:44:13 +0700 Subject: [PATCH] fix: Add method readyNow() to support Horizon --- src/Queue/RabbitMQQueue.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Queue/RabbitMQQueue.php b/src/Queue/RabbitMQQueue.php index 957620ef..2c4d9afe 100644 --- a/src/Queue/RabbitMQQueue.php +++ b/src/Queue/RabbitMQQueue.php @@ -73,6 +73,17 @@ public function __construct(QueueConfig $config) $this->dispatchAfterCommit = $config->isDispatchAfterCommit(); } + /** + * Get the number of queue jobs that are ready to process. + * + * @param string|null $queue + * @return int + */ + public function readyNow($queue = null): int + { + return $this->size($queue); + } + /** * {@inheritdoc} *