Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

!!! FEATURE: Extend the QueueInterface with countReserved and countFailed #29

Merged
merged 4 commits into from
May 30, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
!!! TASK: Remove the count() method completely
Which is replaced by countReady() now.
daniellienert committed May 29, 2018
commit 1b1e67e3032f709b518993301142524b2a1c0fee
5 changes: 4 additions & 1 deletion Classes/Command/JobCommandController.php
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@
use Neos\Cache\Frontend\VariableFrontend;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Cli\CommandController;
use Neos\Flow\Mvc\Exception\StopActionException;

/**
* Job command controller
@@ -62,6 +63,7 @@ class JobCommandController extends CommandController
* @param int $limit If set, only the given amount of jobs are processed (successful or not) before the script exits
* @param bool $verbose Output debugging information
* @return void
* @throws StopActionException
*/
public function workCommand($queue, $exitAfter = null, $limit = null, $verbose = false)
{
@@ -123,11 +125,12 @@ public function workCommand($queue, $exitAfter = null, $limit = null, $verbose =
* @param string $queue The name of the queue
* @param integer $limit Number of jobs to list (some queues only support a limit of 1)
* @return void
* @throws JobQueueException
*/
public function listCommand($queue, $limit = 1)
{
$jobs = $this->jobManager->peek($queue, $limit);
$totalCount = $this->queueManager->getQueue($queue)->count();
$totalCount = $this->queueManager->getQueue($queue)->countReady();
foreach ($jobs as $job) {
$this->outputLine('<b>%s</b>', [$job->getLabel()]);
}
8 changes: 0 additions & 8 deletions Classes/Queue/FakeQueue.php
Original file line number Diff line number Diff line change
@@ -143,14 +143,6 @@ public function peek($limit = 1)
return [];
}

/**
* @inheritdoc
*/
public function count(): int
{
return $this->countReady();
}

/**
* @inheritdoc
*/
8 changes: 0 additions & 8 deletions Classes/Queue/QueueInterface.php
Original file line number Diff line number Diff line change
@@ -101,14 +101,6 @@ public function finish($messageId);
*/
public function peek($limit = 1);

/**
* Get a count of ready messages currently in the queue.
*
* @return int The number of ready messages in the queue
* @deprecated Will be removed with the next major. Use countReady instead.
*/
public function count(): int;

/**
* Get a count of ready messages currently in the queue.
*
8 changes: 0 additions & 8 deletions Tests/Unit/Fixtures/TestQueue.php
Original file line number Diff line number Diff line change
@@ -207,14 +207,6 @@ public function peek($limit = 1)
return $messages;
}

/**
* @inheritdoc
*/
public function count(): int
{
return $this->countReady();
}

/**
* @inheritdoc
*/