def dispatch(self, action, request, *args, **kwargs): if not hasattr(self, action): raise NotFound() return getattr(self, action)(request, *args, **kwargs)
def dispatch(self, action, *args, **kwargs): if not hasattr(self, action): raise NotFound() response = yield as_future(lambda: getattr(self, action)(*args, **kwargs)) raise gen.Return(response)