diff --git a/Classes/Queue/RedisQueue.php b/Classes/Queue/RedisQueue.php index bae833f..20785b0 100644 --- a/Classes/Queue/RedisQueue.php +++ b/Classes/Queue/RedisQueue.php @@ -193,14 +193,33 @@ public function peek($limit = 1) /** * @inheritdoc */ - public function count() + public function countReady(): int { $this->checkClientConnection(); return $this->client->lLen("queue:{$this->name}:messages"); } + /** + * @inheritdoc + */ + public function countReserved(): int + { + $this->checkClientConnection(); + return $this->client->lLen("queue:{$this->name}:processing"); + } + + /** + * @inheritdoc + */ + public function countFailed(): int + { + $this->checkClientConnection(); + return $this->client->lLen("queue:{$this->name}:failed"); + } + /** * @return void + * @throws JobQueueException */ public function setUp() { @@ -279,4 +298,4 @@ protected function connectClient() } return $connected; } -} \ No newline at end of file +} diff --git a/composer.json b/composer.json index a72e05a..820475b 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "MIT", "require": { "ext-redis": "*", - "flowpack/jobqueue-common": "^2.0" + "flowpack/jobqueue-common": "^3.0 || dev-master" }, "autoload": { "psr-4": {