I have a backend that consumes a queue in its starting handler. When the queue is exhausted, the start handler will stop. I want the backend to stop when the start handler ends. I have another code that will send a request to the backend if it adds an item to this queue. These requests simply serve to cause GAE to launch the backend so that it can start consuming the queue.
I do not want the backend to ever be in a state where the start handler has completed, but the backend remains inactive. I want it to stop, so the next server request will cause GAE to start the backend again, run the start handler again and start consuming the queue.
How to achieve this goal?
source share