from typing import Awaitable
from typing import Any
import asyncio


def run(convMethod: Awaitable) -> Any:
	"""Use `pyrlottie.run(convMethod)` or `asyncio.get_event_loop().run_until_complete(convMethod)`
	in place of `asyncio.run(convMethod)`
	See https://github.com/awestlake87/pyo3-asyncio/issues/19#issuecomment-846686814
	for more information
	Run until the future (an instance of Future) has completed.
	If the argument is a coroutine object it is implicitly scheduled to run as a asyncio.Task.
	Return the Future’s result or raise its exception.
	Args:
		convMethod (Awaitable): Awaitable to run. eg.
		convSingleLottie(gLottieFile, destFiles={"test_data/convSingleLottie.webp"})
	Returns:
		Any: the Awaitable's result or raise its exception.
	"""
	return asyncio.get_event_loop().run_until_complete(convMethod)