I am using @asyncio.coroutine with yield and return. and asyncio.gather. It works very well and I can call asyncio.gather from a regular python function. But I see coroutine decorator is deprecated. So I tried the new async and await syntax. It doesn’t work the same. A few observations, and if I’m wrong please correct.
- In the new syntax it wants me to use async function and await, but I can’t return a value from this? When I try to use yield (like a proper coroutine should) it turns it into a generator.
- This forces all my functions that call functions leading up to an async function to also be async?
I couldn’t get the same behavior as before.