import asyncio
from aioreactive.core import AsyncObservable, run
async def generator():
# Also fails with sync generators
for i in range(10):
if i > 2:
print("Let's raise")
raise ValueError(i)
# stream hangs here
await asyncio.sleep(.1)
print('Yield', i)
yield i
async def main():
iterable = generator()
observer = AsyncObservable.from_iterable(iterable)
await run(observer, timeout=None)
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
So the flow is simply hangs after the exception is thrown in the generator
So the flow is simply hangs after the exception is thrown in the generator