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
|
module in order to select a protocol id to communicate over
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@abstractmethod
|
async def handshake(self, communicator: IMultiselectCommunicator) -> None:
|
||||||
async def select_protocol_or_fail(
|
|
||||||
self, protocol: TProtocol, communicator: IMultiselectCommunicator
|
|
||||||
) -> TProtocol:
|
|
||||||
"""
|
"""
|
||||||
Send message to multiselect selecting protocol
|
Ensure that the client and multiselect
|
||||||
and fail if multiselect does not return same protocol
|
are both using the same multiselect protocol
|
||||||
:param protocol: protocol to select
|
|
||||||
:param stream: stream to communicate with multiselect over
|
:param stream: stream to communicate with multiselect over
|
||||||
:return: selected protocol
|
:raise Exception: multiselect protocol ID mismatch
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
@ -37,3 +33,14 @@ class IMultiselectClient(ABC):
|
|||||||
:param stream: stream to communicate with multiselect over
|
:param stream: stream to communicate with multiselect over
|
||||||
:return: selected protocol
|
: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