2019-08-11 16:47:54 +08:00
|
|
|
from typing import TYPE_CHECKING, Awaitable, Callable, NewType, Union
|
2019-08-07 18:02:30 +08:00
|
|
|
|
2019-08-20 18:09:36 +08:00
|
|
|
from libp2p.network.connection.raw_connection_interface import IRawConnection
|
|
|
|
|
2019-08-11 16:47:54 +08:00
|
|
|
if TYPE_CHECKING:
|
|
|
|
from libp2p.network.stream.net_stream_interface import INetStream # noqa: F401
|
|
|
|
from libp2p.stream_muxer.abc import IMuxedStream # noqa: F401
|
2019-08-07 18:02:30 +08:00
|
|
|
|
|
|
|
TProtocol = NewType("TProtocol", str)
|
2019-08-11 16:47:54 +08:00
|
|
|
StreamHandlerFn = Callable[["INetStream"], Awaitable[None]]
|
2019-08-08 15:58:30 +08:00
|
|
|
|
|
|
|
|
2019-08-20 18:09:36 +08:00
|
|
|
StreamReader = Union["IMuxedStream", IRawConnection]
|