mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
refactored and moved all interfaces to abc.py (#504)
* refactored : host_interface Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com> * refactored : network_interface Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com> * refactored : notifee_interface Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com> * refactored : net_connection_interface Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com> * refactored: raw_connection_interface, secure_conn_interface and stream_muxer abc.py * refactored: addrbook_interface * refactored :peerdata_interface Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com> * refactored :peermetadata_interface Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com> * refactored :multiselect_client_interface Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com> * refactored :multiselect_communicator_interface Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com> * refactored :multiselect_muxer_interface Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com> * refactored :interfaces Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com> * refactored :security_transport_interface Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com> * refactored :listener_interface Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com> * moved all interfaces and typing files Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com> * fixed documentation and moved pubsub abc.py Co-authored-by: Khwahish Patel <khwahish.p1@ahduni.edu.in> * added exclude-members in custom_types docs * added : newsfragment for moving all interfaces to libp2p.abc --------- Co-authored-by: mystical-prog <jdgt.vd.0405@gmail.com> Co-authored-by: Mystical <125946525+mystical-prog@users.noreply.github.com>
This commit is contained in:
@ -1,28 +0,0 @@
|
||||
from abc import (
|
||||
abstractmethod,
|
||||
)
|
||||
|
||||
import trio
|
||||
|
||||
from libp2p.io.abc import (
|
||||
Closer,
|
||||
)
|
||||
from libp2p.network.stream.net_stream_interface import (
|
||||
INetStream,
|
||||
)
|
||||
from libp2p.stream_muxer.abc import (
|
||||
IMuxedConn,
|
||||
)
|
||||
|
||||
|
||||
class INetConn(Closer):
|
||||
muxed_conn: IMuxedConn
|
||||
event_started: trio.Event
|
||||
|
||||
@abstractmethod
|
||||
async def new_stream(self) -> INetStream:
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
def get_streams(self) -> tuple[INetStream, ...]:
|
||||
...
|
||||
@ -1,3 +1,6 @@
|
||||
from libp2p.abc import (
|
||||
IRawConnection,
|
||||
)
|
||||
from libp2p.io.abc import (
|
||||
ReadWriteCloser,
|
||||
)
|
||||
@ -8,9 +11,6 @@ from libp2p.io.exceptions import (
|
||||
from .exceptions import (
|
||||
RawConnError,
|
||||
)
|
||||
from .raw_connection_interface import (
|
||||
IRawConnection,
|
||||
)
|
||||
|
||||
|
||||
class RawConnection(IRawConnection):
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
from libp2p.io.abc import (
|
||||
ReadWriteCloser,
|
||||
)
|
||||
|
||||
|
||||
class IRawConnection(ReadWriteCloser):
|
||||
"""A Raw Connection provides a Reader and a Writer."""
|
||||
|
||||
is_initiator: bool
|
||||
@ -4,16 +4,14 @@ from typing import (
|
||||
|
||||
import trio
|
||||
|
||||
from libp2p.network.connection.net_connection_interface import (
|
||||
from libp2p.abc import (
|
||||
IMuxedConn,
|
||||
IMuxedStream,
|
||||
INetConn,
|
||||
)
|
||||
from libp2p.network.stream.net_stream import (
|
||||
NetStream,
|
||||
)
|
||||
from libp2p.stream_muxer.abc import (
|
||||
IMuxedConn,
|
||||
IMuxedStream,
|
||||
)
|
||||
from libp2p.stream_muxer.exceptions import (
|
||||
MuxedConnUnavailable,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user