At the moment I don't have async code. My Tornado cost looks like
class EmployeeHandler(tornado.web.RequestHandler):
'''Returns all users which satisfy conditions'''
def post(self):
data = tornado.escape.json_decode(self.request.body)
age = data['age']
education = data['education']
result = self._filter(education, age)
self.write(json.dumps(result))
self.flush()
def _filter(self, education, age):
'''Reads from local database a lot using SQLAlchemy, make joins and is slow'''
pass
Is there easy way to make this async, to fetch result from filter asynchronously?