PR feedback
- Use f-string - Fix wrongly indented comments - Add dep `trio-typing`
This commit is contained in:
parent
095a848f30
commit
e57d01f360
|
@ -63,7 +63,7 @@ async def run(port: int, destination: str) -> None:
|
||||||
|
|
||||||
nursery.start_soon(read_data, stream)
|
nursery.start_soon(read_data, stream)
|
||||||
nursery.start_soon(write_data, stream)
|
nursery.start_soon(write_data, stream)
|
||||||
print("Connected to peer %s" % info.addrs[0])
|
print(f"Connected to peer {info.addrs[0]}")
|
||||||
|
|
||||||
await trio.sleep_forever()
|
await trio.sleep_forever()
|
||||||
|
|
||||||
|
|
|
@ -60,9 +60,9 @@ class SwarmConn(INetConn):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
stream = await self.muxed_conn.accept_stream()
|
stream = await self.muxed_conn.accept_stream()
|
||||||
# Asynchronously handle the accepted stream, to avoid blocking the next stream.
|
|
||||||
except MuxedConnUnavailable:
|
except MuxedConnUnavailable:
|
||||||
break
|
break
|
||||||
|
# Asynchronously handle the accepted stream, to avoid blocking the next stream.
|
||||||
self.swarm.manager.run_task(self._handle_muxed_stream, stream)
|
self.swarm.manager.run_task(self._handle_muxed_stream, stream)
|
||||||
|
|
||||||
await self.close()
|
await self.close()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user