add NegotiableTransport type

This commit is contained in:
Chih Cheng Liang
2019-08-08 15:58:30 +08:00
committed by Kevin Mai-Husan Chia
parent 9851ee01fb
commit dbb702548f
5 changed files with 15 additions and 12 deletions

View File

@ -1,7 +1,6 @@
from typing import Dict, Tuple
from libp2p.stream_muxer.abc import IMuxedStream
from libp2p.typing import StreamHandlerFn, TProtocol
from libp2p.typing import NegotiableTransport, StreamHandlerFn, TProtocol
from .multiselect_communicator import MultiselectCommunicator
from .multiselect_communicator_interface import IMultiselectCommunicator
@ -31,7 +30,7 @@ class Multiselect(IMultiselectMuxer):
"""
self.handlers[protocol] = handler
async def negotiate(self, stream: IMuxedStream) -> Tuple[TProtocol, StreamHandlerFn]:
async def negotiate(self, stream: NegotiableTransport) -> Tuple[TProtocol, StreamHandlerFn]:
"""
Negotiate performs protocol selection
:param stream: stream to negotiate on