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
50
50
-
Below is the examples for Python 3.6 and above which introduced asynchronous generators as a language concept.
51
+
Below are the examples for Python 3.6 and above which introduced asynchronous generators as a language concept.
51
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.
52
53
Just mark yielding coroutines with `@async_generator` decorator and use `await yield_(value)` and `await yield_from_(async_iterable)` instead of `yield`.
53
54
@@ -98,7 +99,7 @@ async def main():
98
99
99
100
100
101
if__name__=="__main__":
101
-
curio.run(main) # Or trio.run(main)
102
+
curio.run(main) # Or trio.run(main), or run in asyncio event loop
102
103
```
103
104
104
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