You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: `greeter_grpc` module is generated by purerpc's `protoc-gen-purerpc` plugin
49
+
NOTE: `greeter_grpc` module is generated by purerpc's `protoc-gen-purerpc` plugin.
50
+
51
+
Below are the examples for Python 3.6 and above which introduced asynchronous generators as a language concept.
52
+
For Python 3.5, where native asynchronous generators are not supported, you can use [async_generator](https://github.com/python-trio/async_generator) library for this purpose.
53
+
Just mark yielding coroutines with `@async_generator` decorator and use `await yield_(value)` and `await yield_from_(async_iterable)` instead of `yield`.
49
54
50
55
### Server
51
56
@@ -94,7 +99,7 @@ async def main():
94
99
95
100
96
101
if__name__=="__main__":
97
-
curio.run(main) # Or trio.run(main)
102
+
curio.run(main) # Or trio.run(main), or run in asyncio event loop
98
103
```
99
104
100
105
You can mix server and client code, for example make a server that requests something using purerpc from another gRPC server, etc.
0 commit comments