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,7 @@
from typing import Sequence
from libp2p.stream_muxer.abc import IMuxedStream
from libp2p.typing import TProtocol
from libp2p.typing import NegotiableTransport, TProtocol
from .multiselect_client_interface import IMultiselectClient
from .multiselect_communicator import MultiselectCommunicator
@ -59,7 +59,7 @@ class MultiselectClient(IMultiselectClient):
return selected_protocol
async def select_one_of(
self, protocols: Sequence[TProtocol], stream: IMuxedStream
self, protocols: Sequence[TProtocol], stream: NegotiableTransport
) -> TProtocol:
"""
For each protocol, send message to multiselect selecting protocol