| f | import asyncio | f | 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 |
| | | |
| 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): |
| t | await super().reset() | t | super().reset() |
| self.topic = None | | self.topic = None |