The idea of PULL queues is to have a worker always alive to continuously 
check the PULL queue to see if there are any new tasks for it. This design 
relies on you always having an instance running your worker's 'while' loop 
to continuously poll the PULL queue at time intervals. Since you instead 
want to allow your worker to be shut down to ideally save on instances 
hours, I would instead suggest you look into PUSH queues 
<https://cloud.google.com/appengine/docs/python/taskqueue/push/>. 

With PUSH queues, your worker instance is only ever awake when there is a 
new task for it to perform; meaning it gets to shutdown when there is 
nothing left for it to do, and it never has to poll the queue. This works 
by creating URL task handlers 
<https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers>
 
for your workers. By exposing your worker with a URL endpoint, a PUSH queue 
only needs to make a request to your worker's URL to wake it up. Your 
worker then accepts the payload of the HTTP request made to its URL 
handler, and begins doing its work on that data. Once it is done working, 
it then becomes idle and can be shutdown by App Engine until a new task is 
enqueued and the PUSH queue makes a new request to your worker. 



-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/45515301-4e13-4064-ab75-843954c127f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to