mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Add automatic docstring formatter and apply
This commit is contained in:
@ -8,15 +8,13 @@ from libp2p.typing import TProtocol
|
||||
|
||||
|
||||
class IMultiselectClient(ABC):
|
||||
"""
|
||||
Client for communicating with receiver's multiselect
|
||||
module in order to select a protocol id to communicate over
|
||||
"""
|
||||
"""Client for communicating with receiver's multiselect module in order to
|
||||
select a protocol id to communicate over."""
|
||||
|
||||
async def handshake(self, communicator: IMultiselectCommunicator) -> None:
|
||||
"""
|
||||
Ensure that the client and multiselect
|
||||
are both using the same multiselect protocol
|
||||
"""Ensure that the client and multiselect are both using the same
|
||||
multiselect protocol.
|
||||
|
||||
:param stream: stream to communicate with multiselect over
|
||||
:raise Exception: multiselect protocol ID mismatch
|
||||
"""
|
||||
@ -25,10 +23,10 @@ class IMultiselectClient(ABC):
|
||||
async def select_one_of(
|
||||
self, protocols: Sequence[TProtocol], communicator: IMultiselectCommunicator
|
||||
) -> TProtocol:
|
||||
"""
|
||||
For each protocol, send message to multiselect selecting protocol
|
||||
"""For each protocol, send message to multiselect selecting protocol
|
||||
and fail if multiselect does not return same protocol. Returns first
|
||||
protocol that multiselect agrees on (i.e. that multiselect selects)
|
||||
|
||||
:param protocol: protocol to select
|
||||
:param stream: stream to communicate with multiselect over
|
||||
:return: selected protocol
|
||||
@ -37,8 +35,8 @@ class IMultiselectClient(ABC):
|
||||
async def try_select(
|
||||
self, communicator: IMultiselectCommunicator, protocol: TProtocol
|
||||
) -> TProtocol:
|
||||
"""
|
||||
Try to select the given protocol or raise exception if fails
|
||||
"""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
|
||||
|
||||
Reference in New Issue
Block a user