What's he up to?
Tokens and Buckets in the App Engine Task Queue
From Kees van den Broek. April 16, 2010, No Comments
Here’s my understanding of the Task Queue processes on the Google App Engine. A summary, so I won’t forget.

According to the documentation, there are 2 settings to a task queue: rate and bucket_size.
On the left side of the picture, the ‘token generator’ adds tokens to the bucket a a certain rate. For example 2 per minute to slowly fill up the bucket, or 5 per second to speed it up. The generator stops adding tokens to the bucket when the bucket is full (defined by bucket_size).
On the right side, there’s the Task Queue, holding tasks the user enqueued from the App.
In the middle, another process kicks in when there’s at least one token in the bucket and at least one task waiting in the Task Queue. If that’s the case, one token is taken out of the bucket (and thrown away), and one task is taken out of the Task Queue for immediate processing. If the task ended successfully, the task will be thrown away as well, and we’re done. If the task failed to run, it gets re-added to the Task Queue for trying again later.
When there are at least 2 tokens in the bucket and 2 tasks in the Task Queue, they process in the middle may run in parallel.