summaryrefslogtreecommitdiff
path: root/kvmd/aiotools.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-03-01 04:30:32 +0300
committerDevaev Maxim <[email protected]>2020-03-01 04:30:32 +0300
commit44b0ab19bf33a2bdd0d9637f14128f968cf1764e (patch)
tree268d522f27e223ee96f7cfbac12a40c9e0ff5435 /kvmd/aiotools.py
parentff6e284e64c0e0a9e496fc047786a7d9c3aa907b (diff)
no more busyloops in stub plugins
Diffstat (limited to 'kvmd/aiotools.py')
-rw-r--r--kvmd/aiotools.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/kvmd/aiotools.py b/kvmd/aiotools.py
index 993209d1..9f854489 100644
--- a/kvmd/aiotools.py
+++ b/kvmd/aiotools.py
@@ -105,6 +105,11 @@ def run_sync(coro: Coroutine[Any, Any, _RetvalT]) -> _RetvalT:
# =====
+async def wait_infinite() -> None:
+ await asyncio.get_event_loop().create_future()
+
+
+# =====
@contextlib.asynccontextmanager
async def unlock_only_on_exception(lock: asyncio.Lock) -> AsyncGenerator[None, None]:
await lock.acquire()