I have a script that add tasks to a queue. For example:
api.py:
from google.appengine.api import taskqueue
[...]
for u in users:
taskqueue.add(queue_name='mailqueue', url="/api/users/send-notification/%s" % (u.id), method='GET')
I would like to check if the queue is empty and all tasks are finishing
view.py:
if queue_is_empty:
print "Your task is finished"
You can use the QueueStatistics class
https://cloud.google.com/appengine/docs/python/taskqueue/queue_statistics#QueueStatistics_queue