Matt Wong-Kemp
07/21/2020, 7:24 PMasync def do_thing_async_impl(a,b,c):
await ...
...
@task
def do_thing(a,b,c):
return asyncio.run_until.complete(do_thing_async(a,b,c))
but I'm getting an error: Future <Future pending cb=[BaseSelectorEventLoop._sock_connect_done(9)()]> attached to a different loop')
Before I got digging into event loop fun, is there an easier way to do an async task?Jim Crist-Harif
07/21/2020, 7:28 PMasyncio.run
instead of asyncio.run_until.complete
? I'd expect this to work. The issue you're seeing above relates to mixing event loops - some code is creating futures/sockets/stuff in one event loop and trying to use them in another event loop.Matt Wong-Kemp
07/21/2020, 7:29 PMrun