update
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import logging
|
||||
_logger = logging.getLogger(__name__)
|
||||
import asyncio
|
||||
|
||||
def run_async_function(func_to_run, *args):
|
||||
new_loop = asyncio.new_event_loop()
|
||||
try:
|
||||
asyncio.set_event_loop(new_loop)
|
||||
return new_loop.run_until_complete(func_to_run(*args))
|
||||
finally:
|
||||
new_loop.close()
|
||||
Reference in New Issue
Block a user