11 lines
211 B
Python
11 lines
211 B
Python
|
import asyncio
|
||
|
|
||
|
|
||
|
def executor(func):
|
||
|
async def wrapper(*args, **kwargs):
|
||
|
await asyncio.get_event_loop().run_in_executor(
|
||
|
None, lambda: func(*args, **kwargs)
|
||
|
)
|
||
|
|
||
|
return wrapper
|