no more busyloops in stub plugins

This commit is contained in:
Devaev Maxim
2020-03-01 04:30:32 +03:00
parent ff6e284e64
commit 44b0ab19bf
3 changed files with 11 additions and 5 deletions

View File

@@ -20,13 +20,14 @@
# ========================================================================== #
import asyncio
import contextlib
from typing import Dict
from typing import AsyncGenerator
from typing import Optional
from ... import aiotools
from . import MsdOperationError
from . import BaseMsd
@@ -55,7 +56,7 @@ class Plugin(BaseMsd):
async def poll_state(self) -> AsyncGenerator[Dict, None]:
while True:
yield (await self.get_state())
await asyncio.sleep(60)
await aiotools.wait_infinite()
async def reset(self) -> None:
raise MsdDisabledError()