Message259044
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 |
|
Date |
User |
Action |
Args |
2016-01-27 18:45:49 | ikelly | set | recipients:
+ ikelly, gvanrossum, vstinner, yselivanov |
2016-01-27 18:45:49 | ikelly | set | messageid: <1453920349.92.0.761425220481.issue26221@psf.upfronthosting.co.za> |
2016-01-27 18:45:49 | ikelly | link | issue26221 messages |
2016-01-27 18:45:49 | ikelly | create | |
|