nest_asyncio icon indicating copy to clipboard operation
nest_asyncio copied to clipboard

feature request: unapply

Open hjalmarlucius opened this issue 3 years ago • 1 comments

It would be great to have an unapply function or the ability to use this as a context manager so that one can allow nested asyncio only in special circumstances, e.g.:

async def afunc():
    ...

def func():
    with nested_asyncio.apply_now() as loop:
        loop.run_until_complete(afunc)
    asyncio.get_event_loop().loop.run_until_complete(afunc) <- raises error

hjalmarlucius avatar Dec 31 '21 03:12 hjalmarlucius

Yes please! nest-asyncio can break a lot of other packages that aren't expecting it.

rmorshea avatar May 19 '23 21:05 rmorshea