Refactor mplex and start to add close detection

This commit is contained in:
mhchia
2019-09-12 00:38:12 +08:00
parent 7483da762e
commit 0bd213bbb7
8 changed files with 153 additions and 109 deletions

View File

@ -0,0 +1,18 @@
from abc import abstractmethod
from typing import Tuple
from libp2p.io.abc import Closer
from libp2p.network.stream.net_stream_interface import INetStream
from libp2p.stream_muxer.abc import IMuxedConn
class INetConn(Closer):
conn: IMuxedConn
@abstractmethod
async def new_stream(self) -> INetStream:
...
@abstractmethod
async def get_streams(self) -> Tuple[INetStream, ...]:
...