EmperorFred/libs/RestartController.py

14 lines
310 B
Python
Raw Permalink Normal View History

2025-12-06 02:21:47 +00:00
import asyncio
class RestartController:
def __init__(self) -> None:
self._event = asyncio.Event()
def request(self) -> None:
self._event.set()
def consume(self) -> bool:
if self._event.is_set():
self._event.clear()
return True
return False