Slightly simplify gRPC helper functions

This commit is contained in:
Daniel G. Taylor
2019-10-28 20:58:33 -07:00
parent 52beeb0d73
commit 706bd5a475
2 changed files with 14 additions and 10 deletions

View File

@@ -81,17 +81,15 @@ class {{ service.py_name }}Stub(betterproto.ServiceStub):
{% if method.server_streaming %}
async for response in self._unary_stream(
"{{ method.route }}",
{{ method.input }},
{{ method.output }},
request,
{{ method.output }},
):
yield response
{% else %}
return await self._unary_unary(
"{{ method.route }}",
{{ method.input }},
{{ method.output }},
request,
{{ method.output }},
)
{% endif %}