这段代码可以在googleappengine中创建线程吗。如果没有,为什么不呢? 类LogText(数据库模型): 内容=数据库StringProperty(多行=真)
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('')
appengine不允许您创建新线程,这可能是因为appengine的主要目标是构建简单的请求-响应应用程序,而线程通常不被认为是“简单的”。在
管理应用程序的线程以防止滥用(意外或其他)对appengine来说是困难的,或者不可能做到的,所以他们完全不允许这样做。在
相关问题 更多 >
编程相关推荐