Index: third_party/mojo/src/mojo/public/python/mojo_bindings/reflection.py |
diff --git a/third_party/mojo/src/mojo/public/python/mojo_bindings/reflection.py b/third_party/mojo/src/mojo/public/python/mojo_bindings/reflection.py |
index cec05faec5286c2cad81ea224723b9fa61c38a65..e41601a6d0c8960e06e0049f94fbe0d28d7c2fe1 100644 |
--- a/third_party/mojo/src/mojo/public/python/mojo_bindings/reflection.py |
+++ b/third_party/mojo/src/mojo/public/python/mojo_bindings/reflection.py |
@@ -534,6 +534,7 @@ def _StubAccept(methods): |
payload.data, payload.handles)).AsDict() |
response = getattr(self.impl, method.name)(**parameters) |
if header.expects_response: |
+ @promise.async |
def SendResponse(response): |
if isinstance(response, dict): |
response_message = _GetMessage(method, |
@@ -544,8 +545,8 @@ def _StubAccept(methods): |
messaging.MESSAGE_IS_RESPONSE_FLAG, |
response) |
response_message.header.request_id = header.request_id |
- responder.Accept(response_message) |
- p = promise.Promise.Resolve(response).Then(SendResponse) |
+ return responder.Accept(response_message) |
+ p = SendResponse(response) |
if self.impl.manager: |
# Close the connection in case of error. |
p.Catch(lambda _: self.impl.manager.Close()) |