mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Use RawConnection.read
Instead of accessing its reader and writer directly. TODO: considering add `ReaderWriterCloser` interface and let connection and stream inherit from it.
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import asyncio
|
||||
from typing import TYPE_CHECKING, Awaitable, Callable, NewType, Union
|
||||
|
||||
from libp2p.network.connection.raw_connection_interface import IRawConnection
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from libp2p.network.stream.net_stream_interface import INetStream # noqa: F401
|
||||
from libp2p.stream_muxer.abc import IMuxedStream # noqa: F401
|
||||
@ -9,4 +10,4 @@ TProtocol = NewType("TProtocol", str)
|
||||
StreamHandlerFn = Callable[["INetStream"], Awaitable[None]]
|
||||
|
||||
|
||||
StreamReader = Union["IMuxedStream", asyncio.StreamReader]
|
||||
StreamReader = Union["IMuxedStream", IRawConnection]
|
||||
|
||||
Reference in New Issue
Block a user