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:
@ -7,18 +7,16 @@ from .multiselect_communicator_interface import IMultiselectCommunicator
|
||||
|
||||
|
||||
class IMultiselectMuxer(ABC):
|
||||
"""
|
||||
Multiselect module that is responsible for responding to
|
||||
a multiselect client and deciding on
|
||||
a specific protocol and handler pair to use for communication
|
||||
"""
|
||||
"""Multiselect module that is responsible for responding to a multiselect
|
||||
client and deciding on a specific protocol and handler pair to use for
|
||||
communication."""
|
||||
|
||||
handlers: Dict[TProtocol, StreamHandlerFn]
|
||||
|
||||
@abstractmethod
|
||||
def add_handler(self, protocol: TProtocol, handler: StreamHandlerFn) -> None:
|
||||
"""
|
||||
Store the handler with the given protocol
|
||||
"""Store the handler with the given protocol.
|
||||
|
||||
:param protocol: protocol name
|
||||
:param handler: handler function
|
||||
"""
|
||||
@ -27,8 +25,8 @@ class IMultiselectMuxer(ABC):
|
||||
async def negotiate(
|
||||
self, communicator: IMultiselectCommunicator
|
||||
) -> Tuple[TProtocol, StreamHandlerFn]:
|
||||
"""
|
||||
Negotiate performs protocol selection
|
||||
"""Negotiate performs protocol selection.
|
||||
|
||||
:param stream: stream to negotiate on
|
||||
:return: selected protocol name, handler function
|
||||
:raise Exception: negotiation failed exception
|
||||
|
||||
Reference in New Issue
Block a user