Unsynchronize asyncio by using an ambient event loop in a separate thread.
copied from cf-staging / unsyncunsync implements a unsync function decorator that will implement minimal boilerplate threading, asyncio or multiprocessing depending on the context. It is pure Python code with no dependencies.