Make Mplex and SwarmConn not Service

After second thoughts, they seem not a good candidate of `Service`.
The shutdown logic becomes simpler by making them not `Service`.
This commit is contained in:
mhchia
2020-01-07 21:50:03 +08:00
parent eab59482c0
commit eef241e70e
7 changed files with 43 additions and 61 deletions

View File

@ -188,9 +188,7 @@ class MplexStream(IMuxedStream):
if self.is_initiator
else HeaderTags.ResetReceiver
)
self.muxed_conn.manager.run_task(
self.muxed_conn.send_message, flag, None, self.stream_id
)
await self.muxed_conn.send_message(flag, None, self.stream_id)
self.event_local_closed.set()
self.event_remote_closed.set()