eventloop: add low level eventloop property
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
73df63db1f
commit
9d0d09de80
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue