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")
有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top