| t | import asyncio | t | import asyncio |
| | | |
| class Portal(asyncio.Barrier): | | class Portal(asyncio.Barrier): |
| | | |
| def __init__(self, parties): | | def __init__(self, parties): |
| super().__init__(parties) | | super().__init__(parties) |
| self._topic = None | | self._topic = None |
| | | |
| @property | | @property |
| def topic(self): | | def topic(self): |
| return self._topic | | return self._topic |
| | | |
| async def wait(self, topic=None): | | async def wait(self, topic=None): |
| if topic is not None: | | if topic is not None: |
| self._topic = topic | | self._topic = topic |
| return await super().wait() | | return await super().wait() |
| | | |
| async def reset(self): | | async def reset(self): |
| self._topic = None | | self._topic = None |
| await super().reset() | | await super().reset() |
| | | |
| async def abort(self): | | async def abort(self): |
| self._topic = None | | self._topic = None |
| await super().abort() | | await super().abort() |