mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-08-17 06:41:17 +03:00
introducer just manage (#16757)
This commit is contained in:
parent
576ec7c08c
commit
6d480b8256
@ -38,22 +38,12 @@ 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
|
||||
|
||||
async def on_connect(self, peer: WSChiaConnection) -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user