mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Add delim_encode and delim_read
- Add `StreamCommunicator` and `RawConnectionCommunicator`, read/write messages with delim codec, with `IMuxedStream` and `IRawConnection` respectively. - Use it in `Multiselect` and `MultiselectClient`.
This commit is contained in:
committed by
Kevin Mai-Husan Chia
parent
8cd23abfe2
commit
86d4ce1da8
@ -1,7 +1,6 @@
|
||||
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
|
||||
@ -10,4 +9,4 @@ TProtocol = NewType("TProtocol", str)
|
||||
StreamHandlerFn = Callable[["INetStream"], Awaitable[None]]
|
||||
|
||||
|
||||
NegotiableTransport = Union["IMuxedStream", IRawConnection]
|
||||
StreamReader = Union["IMuxedStream", asyncio.StreamReader]
|
||||
|
||||
Reference in New Issue
Block a user