Question

Can I block on a Google AppEngine Pull Task Queue until a Task is available? Or, do I need to poll an empty queue until a task is available?

Was it helpful?

Solution

You need to poll the queue. A typical use case for pull queues is to have multiple backends, each obtaining one thousand tasks at a time.

For use cases where there are no tasks in the queue for hours at a time, push queues can be a better fit.

OTHER TIPS

Not 100% sure about your question, but thought to try an answer. Having a pull task queue started by a cron may apply. Saves the expense of running a backend. I have client-side log data that needs to be serialized and stored. On-line handler simply passes the client data to a task pull queue. Cron fires up the task every minute, and up to 10k log items get serialized and stored each run. (Change settings according to your loads -- these more than meet my modest needs.) In this case, the queue acts as a buffer, and load spikes get spread across even processing units. Obviously not useful if you want quick access to the TQ data or have wildly unpredictable loads. Very importantly the log data serialization cuts data writes by a factor of 1,000. May not apply to your question, so I'll end with a big HTH. -stevep

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top