This commit is contained in:
@@ -25,12 +25,12 @@ class Subscriber:
|
|||||||
|
|
||||||
async def wait(self, tout: Optional[float]) -> bool:
|
async def wait(self, tout: Optional[float]) -> bool:
|
||||||
|
|
||||||
future = self._loop.create_future()
|
future: Future[bool] = self._loop.create_future()
|
||||||
self._event = future
|
self._event = future
|
||||||
try:
|
try:
|
||||||
async with timeout(tout):
|
async with timeout(tout):
|
||||||
log.debug('Subscriber %s is waiting for an event', id(self))
|
log.debug('Subscriber %s is waiting for an event', id(self))
|
||||||
await future
|
return await future
|
||||||
except TimeoutError:
|
except TimeoutError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user