In the document , @ web.asynchronous is not required if the method is also decorated with @ gen.coroutine. like this
@web.asynchronous
@gen.coroutine
def get(self):
...
but in the document they also explain that if you use @ web.asynchronous, then you should call self.finish (). However, in the above case (using two decorators together), the connection ends without calling "self.finish ()"
I wonder what happened there.
and in the following case, it differs from the previous one.
@web.asynchronous
def get(self):
self.test()
@gen.coroutine
def test(self):
httpClient = AsyncHttpClient()
val = yield httpClient.fetch("http://www.google.com")
print test
If "self.finish ()" is not called, the connection does not close.
Can this be explained?
source
share