Ian Kelly added the comment:
The idea is that the wrapped iterator is something potentially blocking, like a
database cursor that doesn't natively support asyncio. Usage would be something
like this:
async def get_data():
cursor.execute('select * from stuff')
async for row in AsyncIteratorWrapper(cursor):
process(row)
Investigating this further, I think the problem is actually in await, not
run_in_executor:
>>> async def test():
... fut = asyncio.Future()
... fut.set_exception(StopIteration())
... print(await fut)
...
>>> loop.run_until_complete(test())
None
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26221>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com