Use ReadWriteCloser for conns and streams

This commit is contained in:
mhchia
2019-09-05 23:24:17 +08:00
parent eac159c527
commit 10415cb956
9 changed files with 24 additions and 88 deletions

View File

@ -1,6 +1,4 @@
from typing import TYPE_CHECKING, Awaitable, Callable, NewType, Union
from libp2p.network.connection.raw_connection_interface import IRawConnection
from typing import TYPE_CHECKING, Awaitable, Callable, NewType
if TYPE_CHECKING:
from libp2p.network.stream.net_stream_interface import INetStream # noqa: F401
@ -8,5 +6,3 @@ if TYPE_CHECKING:
TProtocol = NewType("TProtocol", str)
StreamHandlerFn = Callable[["INetStream"], Awaitable[None]]
StreamReader = Union["IMuxedStream", "INetStream", IRawConnection]