Exemplo n.º 1
0
    def Invoke(self, request, context):
        args = rpc.deserialize_properties(request.args)
        failures, ret = self.langhost_test.invoke(context, request.tok, args, request.provider, request.version)
        failures_rpc = list(map(
            lambda fail: provider_pb2.CheckFailure(property=fail["property"], reason=fail["reason"]), failures))

        loop = asyncio.new_event_loop()
        ret_proto = loop.run_until_complete(rpc.serialize_properties(ret, {}))
        loop.close()
        fields = {"failures": failures_rpc, "return": ret_proto}
        return proto.InvokeResponse(**fields)
Exemplo n.º 2
0
 def Invoke(self, request, context):
     args = rpc.deserialize_properties(request.args)
     failures, ret = self.langhost_test.invoke(context, request.tok, args)
     return proto.InvokeResponse(failures=failures, ret=ret)