juriansluiman/SlmQueue — pull request #56 by bakura10 (2013-07-13 22:19:14+00:00)
Title: Add batchable interface

ping @basz

Ok, so after lot of tryings in SQS, I just couldn't make it without a lot of duplication code (because the processQueue expclitely called "pop" and assumed it was a single job, I had to rewrite the whole method… so it had to be updated each time the worker change). This would have been the same problem for all other modules when you'll want to implement batchable interface.

So I preferred instead move this to the SlmQueue. This add a BatchableQueueInterface and a processBatchableQueue method to the worker. The two methods (processQueue and processBatchableQueue) share kind the same code but I couldn't do better.

Now it gets simpler, because I can only override the SqsController and either call processBatchableQueue or processQueue based on the "maxCount" parameter.