aiohttp_jrpc/__init__.py
def __run(self, ctx):
        """ Run service """
        try:
            data = yield from decode(ctx)
        except ParseError:
            return JError().parse()
        except InvalidRequest:
            return JError().request()
        except InternalError:
            return JError().internal()

        try:
            i_app = getattr(self, data['method'])
            i_app = asyncio.coroutine(i_app)
        except Exception:
            return JError(data).method()

        try:
            resp = yield from i_app(self, ctx, data)
        except InvalidParams:
            return JError(data).params()
        except InternalError:
            return JError(data).internal()

        return JResponse(jsonrpc={
            "id": data['id'], "result": resp
            })
def __run(self, ctx):
        """ Run service """
        try:
            data = yield from decode(ctx)
        except ParseError:
            return JError().parse()
        except InvalidRequest:
            return JError().request()
        except InternalError:
            return JError().internal()

        try:
            i_app = getattr(self, data['method'])
            i_app = asyncio.coroutine(i_app)
        except Exception:
            return JError(data).method()

        try:
            resp = yield from i_app(self, ctx, data)
        except InvalidParams:
            return JError(data).params()
        except InternalError:
            return JError(data).internal()

        return JResponse(jsonrpc={
            "id": data['id'], "result": resp
            })
Run service