mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-07-14 22:20:42 +03:00
introducer just manage (#16757)
This commit is contained in:
parent
576ec7c08c
commit
6d480b8256
@ -38,23 +38,13 @@ class Introducer:
|
||||
|
||||
@contextlib.asynccontextmanager
|
||||
async def manage(self) -> AsyncIterator[None]:
|
||||
await self._start()
|
||||
self._vetting_task = asyncio.create_task(self._vetting_loop())
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
self._close()
|
||||
await self._await_closed()
|
||||
|
||||
async def _start(self):
|
||||
self._vetting_task = asyncio.create_task(self._vetting_loop())
|
||||
|
||||
def _close(self):
|
||||
self._shut_down = True
|
||||
self._vetting_task.cancel()
|
||||
|
||||
async def _await_closed(self):
|
||||
pass
|
||||
# await self._vetting_task
|
||||
self._shut_down = True
|
||||
self._vetting_task.cancel()
|
||||
# await self._vetting_task
|
||||
|
||||
async def on_connect(self, peer: WSChiaConnection) -> None:
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user