grevian/AppEngine-Example — pull request #11 by grevian (2013-12-11 06:23:32+00:00)
Title: Initial deferred ratings update workflow

This change ended up being pretty huge

* Reorganized front page building code to be more modular and reusable
* Votes no longer directly change the rating on articles, instead they queue the article to have its rating refreshed
* When the front page articles aren't in the cache, check if we need to update ratings while we query
* So that request still gets the old ratings, but following ones will soon get the updated ratings
* This is done instead of a cron job, to save instance hours on my free appspot account
* If there are updates queued to apply, set up a static marker to keep multiple update jobs from running at once, then fan out and update the ratings on articles

This PR demonstrates the following concepts
* Pull Queues
* Push queues using Deferred
* Queue statistics
* Job/Marker workflow
* Task design (Idempotency, Transactions)
* Task Completion Handlers