Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push vs Pull Queues on Google App Engine

Tags:

So far, no one (not even the GAE docs) has been able to give me a really clear description of what the difference is between a push queue and a pull queue.

My understanding is that the Task Queue API allows you to define task queues where work can be enqueued to. Somehow, this works with GAE's auto-scaling feature so that you don't need to explicitly manage the number of worker threads consuming tasks off these queues: GAE just does it for you.

But nowhere can I find a "King's English" description of the difference between push and pull queues. What is a "push queue" pushing? What is a "pull queue" pulling? Are they both configured inside queues.xml?

like image 863
IAmYourFaja Avatar asked Sep 07 '12 11:09

IAmYourFaja


1 Answers

In a pull queue you enqueue tasks into the queue and your code needs to pull them, you pull them by leasing tasks from the queue and deleting the tasks. if you don't delete the tasks and the lease time is expired the system will return the tasks back to the queue.

You can use pull queue (for example) to aggregate a multiple work units that can be processed together. Another example: queuing task that will be pull by an external machine (like EC2 or gCompute) in order to process the task in a manner that AppEngine can't.

In push queue you enqueue tasks into the queue but AppEngine will dequeue them and will run them on the handler specified by the task. You can control the task processing rate, how to control task execution failures and AppEngine will decide how many instances (threads) to use todo the processing.

like image 50
Shay Erlichmen Avatar answered Sep 24 '22 00:09

Shay Erlichmen