eventloop: add low level eventloop property

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2023-12-05 08:08:34 -05:00
parent 73df63db1f
commit 9d0d09de80
1 changed files with 5 additions and 0 deletions

View File

@ -32,6 +32,7 @@ if _uvl_var in ["y", "yes", "true"]:
_uvl_enabled = True
if TYPE_CHECKING:
from asyncio import AbstractEventLoop
_T = TypeVar("_T")
FlexCallback = Callable[..., Optional[Awaitable]]
TimerCallback = Callable[[float], Union[float, Awaitable[float]]]
@ -42,6 +43,10 @@ class EventLoop:
def __init__(self) -> None:
self.reset()
@property
def asyncio_loop(self) -> AbstractEventLoop:
return self.aioloop
def reset(self) -> None:
self.aioloop = self._create_new_loop()
self.add_signal_handler = self.aioloop.add_signal_handler