Question

I am developing a website using Google App Engine and Django 1.0 (app-engine-patch)

A major part of my program has to run in the background and change local data and also post to a remote URL

Can someone suggest an effective way of doing this?

Was it helpful?

Solution

Without using a third-party system, I think currently your only option is to use the cron functionality.

You'd still be bound by the usual GAE script-execution-time limitations, but it wouldn't happen on a page load.

There is plans for background processing, see this App Engine issue #6, and this roadmap update

OTHER TIPS

I second dbr's recommendation of http://code.google.com/appengine/docs/python/config/cron.html (and hopes for better future approaches, such as the promised "task queues").

Nevertheless I suspect that if you do indeed need major (as in CPU heavy) background processing, GAE may not be the most hospitable environment for that. You may want to consider running those heavy background tasks in other environments, and have them communicate with GAE proper e.g. via the "bulk load/download" APIs, see http://code.google.com/appengine/docs/python/tools/uploadingdata.html (and http://code.google.com/appengine/docs/python/tools/uploadingdata.html#Downloading_Data_from_App_Engine for the downloading part).

Google's documentation only describes the usage of the command-line appcfg.py for these purposes (I can't find a proper documentation of the APIs it uses!), but, if you do need more programmatic usage of these APIs, it's not hard to evince them from appcfg.py's sources.

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