1111 * source code.
1212 */
1313
14+ use Flowpack \JobQueue \Common \Exception ;
1415use Flowpack \JobQueue \Common \Queue \QueueManager ;
1516use Neos \Flow \Annotations as Flow ;
1617use Neos \Flow \Cli \CommandController ;
18+ use Neos \Flow \Mvc \Exception \StopActionException ;
1719use Neos \Utility \TypeHandling ;
1820
1921/**
@@ -40,14 +42,15 @@ class QueueCommandController extends CommandController
4042 * Displays all configured queues, their type and the number of messages that are ready to be processed.
4143 *
4244 * @return void
45+ * @throws Exception
4346 */
4447 public function listCommand ()
4548 {
4649 $ rows = [];
4750 foreach ($ this ->queueConfigurations as $ queueName => $ queueConfiguration ) {
4851 $ queue = $ this ->queueManager ->getQueue ($ queueName );
4952 try {
50- $ numberOfMessages = $ queue ->count ();
53+ $ numberOfMessages = $ queue ->countReady ();
5154 } catch (\Exception $ e ) {
5255 $ numberOfMessages = '- ' ;
5356 }
@@ -63,6 +66,7 @@ public function listCommand()
6366 *
6467 * @param string $queue Name of the queue to describe (e.g. "some-queue")
6568 * @return void
69+ * @throws Exception
6670 */
6771 public function describeCommand ($ queue )
6872 {
@@ -83,6 +87,8 @@ public function describeCommand($queue)
8387 *
8488 * @param string $queue Name of the queue to initialize (e.g. "some-queue")
8589 * @return void
90+ * @throws Exception
91+ * @throws StopActionException
8692 */
8793 public function setupCommand ($ queue )
8894 {
@@ -106,6 +112,8 @@ public function setupCommand($queue)
106112 * @param string $queue Name of the queue to flush (e.g. "some-queue")
107113 * @param bool $force This flag is required in order to avoid accidental flushes
108114 * @return void
115+ * @throws Exception
116+ * @throws StopActionException
109117 */
110118 public function flushCommand ($ queue , $ force = false )
111119 {
@@ -134,6 +142,7 @@ public function flushCommand($queue, $force = false)
134142 * @param string $payload Arbitrary payload, for example a serialized instance of a class implementing JobInterface
135143 * @param string $options JSON encoded, for example '{"some-option": "some-value"}'
136144 * @return void
145+ * @throws Exception
137146 */
138147 public function submitCommand ($ queue , $ payload , $ options = null )
139148 {
0 commit comments