How does 'yield' work in tornado when making an asynchronous call?
Recently, I was learning Introduction to Tornado , and I came across the following code: class IndexHandler(tornado.web.RequestHandler): @tornado.web.asynchronous @tornado.gen.engine def get(self): query = self.get_argument('q') client = tornado.httpclient.AsyncHTTPClient() response = yield tornado.gen.Task(client.fetch, "http://search.twitter.com/search.json?" + \ urllib.urlencode({"q": query, "result_type": "recent", "rpp": 100})) body = json.loads(response.body) [...omitted the following code...] I used to learn that yield is the key word turning a common function into a generator, and when