In the document, @web.asynchronous is unnecessary if the method is also decorated with @gen.coroutine. like this
@web.asynchronous
@gen.coroutine
def get(self):
...
but, In document, They also explain that If you use @web.asynchronous, then you should call self.finish(). However, In above case(using two decorator together) the connection is finished with out calling "self.finish()"
I'm wondering what happened in there.
and In below case, It works different with above.
@web.asynchronous
def get(self):
self.test()
@gen.coroutine
def test(self):
httpClient = AsyncHttpClient()
val = yield httpClient.fetch("http://www.google.com")
print test
#self.finish()
If "self.finish()" is not called the connection is not closed.
Is there anybody can explain this?