mariano / disque-php

PHP library for Disque, an in-memory, distributed job queue
MIT License
132 stars 19 forks source link

Add support for the GETJOB argument WITHCOUNTERS #9

Closed Revisor closed 9 years ago

Revisor commented 9 years ago

This pull request adds support for the GETJOB argument WITHCOUNTERS (see #1).

GETJOB WITHCOUNTERS returns two extra pieces of information for each job:

These two counters can help the client to handle job failures more precisely. For example, the client may decide to retry a failed job three times, but on the fourth failure remove the job from the queue, move it to a dead letter queue and inform the administrators.

I have added documentation as well as tests according to how other classes are covered. Please, do a code review and let me know what I should fix and improve.

Two formal notes:

Thank you for the code review and any suggestions.