문제

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