mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-10 15:10:54 +00:00
Add automatic docstring formatter and apply
This commit is contained in:
@ -14,8 +14,8 @@ class IMuxedConn(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self, conn: ISecureConn, peer_id: ID) -> None:
|
||||
"""
|
||||
create a new muxed connection
|
||||
"""create a new muxed connection.
|
||||
|
||||
:param conn: an instance of secured connection
|
||||
for new muxed streams
|
||||
:param peer_id: peer_id of peer the connection is to
|
||||
@ -28,29 +28,25 @@ class IMuxedConn(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def close(self) -> None:
|
||||
"""
|
||||
close connection
|
||||
"""
|
||||
"""close connection."""
|
||||
|
||||
@abstractmethod
|
||||
def is_closed(self) -> bool:
|
||||
"""
|
||||
check connection is fully closed
|
||||
"""check connection is fully closed.
|
||||
|
||||
:return: true if successful
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
async def open_stream(self) -> "IMuxedStream":
|
||||
"""
|
||||
creates a new muxed_stream
|
||||
"""creates a new muxed_stream.
|
||||
|
||||
:return: a new ``IMuxedStream`` stream
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
async def accept_stream(self) -> "IMuxedStream":
|
||||
"""
|
||||
accepts a muxed stream opened by the other end
|
||||
"""
|
||||
"""accepts a muxed stream opened by the other end."""
|
||||
|
||||
|
||||
class IMuxedStream(ReadWriteCloser):
|
||||
@ -59,14 +55,11 @@ class IMuxedStream(ReadWriteCloser):
|
||||
|
||||
@abstractmethod
|
||||
async def reset(self) -> None:
|
||||
"""
|
||||
closes both ends of the stream
|
||||
tells this remote side to hang up
|
||||
"""
|
||||
"""closes both ends of the stream tells this remote side to hang up."""
|
||||
|
||||
@abstractmethod
|
||||
def set_deadline(self, ttl: int) -> bool:
|
||||
"""
|
||||
set deadline for muxed stream
|
||||
"""set deadline for muxed stream.
|
||||
|
||||
:return: a new stream
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user