Question

final is my remote host file which is very large and due to timeout problems in front-end, i want to run it in back-end.

   large.py
   link=urllib2.urlopen(final)

   backends: 
   name: mybackend
   class: B8 
   options: public, dynamic
   instances: 6
   start: large.py

  main.py <br>
  urllib2.urlrequest("/_ah/start")
Was it helpful?

Solution

Use deferred library, it's taskqueue without needing to create handlers:

from google.appengine.ext import deferred
deferred.defer(yourfile.your_fetcher_method, _target='mybackend')

If you have params anything after the method to run without _ is a numbered params, or named params without underscore.

OTHER TIPS

A basic handler could do this. You invoke the handler via the url on the backend instance. If you use urllib2 you have default timeouts. you can use urlfetch to set the timeout parameters to your needs. A basic project which invokes a handler on the backend is here.

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