py-libp2p/libp2p/typing.py

14 lines
473 B
Python
Raw Normal View History

from typing import TYPE_CHECKING, Awaitable, Callable, NewType, Union
2019-08-07 18:02:30 +08:00
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
2019-08-07 18:02:30 +08:00
TProtocol = NewType("TProtocol", str)
StreamHandlerFn = Callable[["INetStream"], Awaitable[None]]
2019-08-08 15:58:30 +08:00
StreamReader = Union["IMuxedStream", IRawConnection]