add typing to protocol_muxer

This commit is contained in:
Chih Cheng Liang
2019-08-07 18:02:30 +08:00
committed by Kevin Mai-Husan Chia
parent 0d709364f8
commit 5903012e0e
13 changed files with 72 additions and 43 deletions

6
libp2p/typing.py Normal file
View File

@ -0,0 +1,6 @@
from typing import Awaitable, Callable, NewType
from libp2p.network.stream.net_stream_interface import INetStream
TProtocol = NewType("TProtocol", str)
StreamHandlerFn = Callable[[INetStream], Awaitable[None]]