Shutdown module polling the task queue

43 views
Skip to first unread message

André Solberg

unread,
Jun 5, 2015, 5:40:31 AM6/5/15
to google-a...@googlegroups.com

I use Google App Engine as backend for an iOS application. I have a separate module that polls the Task Queue, looking for push notifications queued for sending. The module starts a background thread on /_ah/start and runs as long as the module is running.

The backend has dynamic availability, so when there are no requests for a while it will go idle. When there are no instances running, there is no need for the polling either. After I added the module, the billing charges has increased a lot because of instance hours usage. I'm still developing the app and the backend, so the backend is idle most of the time. I thought I could at least manually shut down the module and only turn it on when I need it for testing. But the module restarts by itself immediately after I shut it down...


How can I implement a good "cooperation" between the default module and the polling module, so that if there are no instances running on the default module, the polling module will automatically shut down?


Christian F. Howes

unread,
Jun 5, 2015, 6:29:54 PM6/5/15
to google-a...@googlegroups.com
I use backend instance class for this with manual scaling:

instance_class: B1
manual_scaling:
  instances: 1

and then in the console i click the stop button next to my version.  It will stay stopped until you click start again or re-deploy.

for a more dynamic version of that i use push queues, but APNS needs to be send int a backend instance.  i have not used it yet, but maybe you can send GCM messages with apple targets using the new GCM for iOS announced last week: https://developers.google.com/cloud-messaging/ios/client  perhaps that can run on a frontend instance with automatic scaling and a push queue?
Reply all
Reply to author
Forward
0 new messages