Update IMultiselectClient
This commit is contained in:
parent
9bad7a61f0
commit
501513b747
@ -13,16 +13,12 @@ class IMultiselectClient(ABC):
|
||||
module in order to select a protocol id to communicate over
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
async def select_protocol_or_fail(
|
||||
self, protocol: TProtocol, communicator: IMultiselectCommunicator
|
||||
) -> TProtocol:
|
||||
async def handshake(self, communicator: IMultiselectCommunicator) -> None:
|
||||
"""
|
||||
Send message to multiselect selecting protocol
|
||||
and fail if multiselect does not return same protocol
|
||||
:param protocol: protocol to select
|
||||
Ensure that the client and multiselect
|
||||
are both using the same multiselect protocol
|
||||
:param stream: stream to communicate with multiselect over
|
||||
:return: selected protocol
|
||||
:raise Exception: multiselect protocol ID mismatch
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@ -37,3 +33,14 @@ class IMultiselectClient(ABC):
|
||||
:param stream: stream to communicate with multiselect over
|
||||
:return: selected protocol
|
||||
"""
|
||||
|
||||
async def try_select(
|
||||
self, communicator: IMultiselectCommunicator, protocol: TProtocol
|
||||
) -> TProtocol:
|
||||
"""
|
||||
Try to select the given protocol or raise exception if fails
|
||||
:param communicator: communicator to use to communicate with counterparty
|
||||
:param protocol: protocol to select
|
||||
:raise Exception: error in protocol selection
|
||||
:return: selected protocol
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user