1
我試圖使用AsyncHTTPClient在龍捲風做多標註爲「裝置」可以通過http:循環使用AsyncHTTPClient(龍捲風,Python)的
def ext_call(self, params):
device = AsyncHTTPClient()
request = HTTPRequest(...)
return partial(device.fetch, request)
@coroutine
def _do_call(self, someid):
acall = self.ext_call(params)
waitkey = str(someid)
acall(callback = (yield Callback(waitkey)))
response = yield Wait(waitkey)
raise Return(response)
def get_device_data(self, lst):
for someid in lst:
r = self._do_call(someid)
print 'response', r
但不是HTTP響應爲AsyncHTTPClient應該返回後.fetch,我得到這個:
response <tornado.concurrent.TracebackFuture object at 0x951840c>
爲什麼這不起作用像http://www.tornadoweb.org/en/stable/gen.html中的例子?