Webador / SlmQueue

Laminas / Mezzio module that integrates with various queue management systems.
Other
137 stars 56 forks source link

Move format output #123

Closed bakura10 closed 10 years ago

bakura10 commented 10 years ago

SQS worker for instance overrides the "processAction" to use its specific options. This allows to reuse it in SlmQueueSqs.

ping @basz

bakura10 commented 10 years ago

@basz I'll let you update Doctrine to take advantage of this

basz commented 10 years ago

I don't think SlmQueueDoctrine nees to be updated?

bakura10 commented 10 years ago

It needs: https://github.com/juriansluiman/SlmQueueDoctrine/blob/master/src/SlmQueueDoctrine/Controller/DoctrineWorkerController.php#L39

You are currently not taking advantage of the returned states.

basz commented 10 years ago

ah right... would it be an idea to make the signature

formatOutput($queueName, array $messages = [], $action = 'processing')
{
...
return sprintf(
            "Finished %s worker for queue '%s':\n%s\n",
            $action,
            $queueName,
            $messages
        );
}

Then that method can be reused by te various actions

basz commented 10 years ago

uhm, actually there are no states returned as the recoverAction does not use a worker even when the Controller is called DoctrineWorkerController. It talks directly to the queue. I think it is okay for now.