gjedeer/celery-php — pull request #39 by MariusKl (2014-11-04 16:39:34+00:00)
Title: Make AsyncResult message visible

Hi,

in our usecase we would like to save the task id of a published task and later ask for the current state of this task without having the original AsyncResult object anymore. We also would like to get custom information as mentioned here http://celery.readthedocs.org/en/latest/userguide/tasks.html#custom-states
Luckily the "custom states" are already stored in the messageBody variable, when a worker adds those information to a message.

Therefore I extended the celery class with a new method getAsyncResultMessage which creates a new AsyncResult and returns the current message of the task in the queue.

Furthermore I made it customizable whether a message is removed from the queue when it was fetched by the client (default is true as it has been before). In our usecase we would like to keep this message in the queue so different clients can fetch this message. It will later removed by celery due to its expire parameter.

Most of the code uses tabs instead of whitespaces. I first worked with whitespaces. Replacing these whitespaces automatically with tabs later has led to some other changes where whitespaces were still used. So the merge requests contains a couple of more changes than excepted.

Let me know if you have any questions about the changes.