我使用GAE和Django的如何讓從來沒有一個線程停止,寫的東西到數據庫中的每個10秒
這是我的代碼:
class LogText(db.Model):
content = db.StringProperty(multiline=True)
class MyThread(threading.Thread):
def __init__(self,threadname):
threading.Thread.__init__(self, name=threadname)
def run(self,request):
log=LogText()
log.content=request.POST.get('content',None)
log.put()
def Log(request):
thr = MyThread('haha')
thr.run(request)
return HttpResponse('')
要做到這一點不在App Engine上,請嘗試此鏈接! www.google.com/search?q=python+thread – 2010-04-23 14:11:12