Add INetStream to type StreamReader

TODO: Make stream readers implement `Reader`
This commit is contained in:
mhchia 2019-09-03 22:59:44 +08:00
parent c6d81d70b3
commit 4f7bb30d82
No known key found for this signature in database
GPG Key ID: 389EFBEA1362589A
2 changed files with 2 additions and 2 deletions

View File

@ -7,6 +7,7 @@ from .net_stream_interface import INetStream
class NetStream(INetStream): class NetStream(INetStream):
muxed_stream: IMuxedStream muxed_stream: IMuxedStream
# TODO: Why we expose `mplex_conn` here?
mplex_conn: IMuxedConn mplex_conn: IMuxedConn
protocol_id: TProtocol protocol_id: TProtocol

View File

@ -9,5 +9,4 @@ if TYPE_CHECKING:
TProtocol = NewType("TProtocol", str) TProtocol = NewType("TProtocol", str)
StreamHandlerFn = Callable[["INetStream"], Awaitable[None]] StreamHandlerFn = Callable[["INetStream"], Awaitable[None]]
StreamReader = Union["IMuxedStream", "INetStream", IRawConnection]
StreamReader = Union["IMuxedStream", IRawConnection]