diff --git a/libp2p/crypto/secp256k1.py b/libp2p/crypto/secp256k1.py index 79ffc9d..0e5b9a5 100644 --- a/libp2p/crypto/secp256k1.py +++ b/libp2p/crypto/secp256k1.py @@ -1,5 +1,4 @@ import coincurve - from libp2p.crypto.keys import KeyPair, KeyType, PrivateKey, PublicKey diff --git a/libp2p/stream_muxer/abc.py b/libp2p/stream_muxer/abc.py index 5c11107..7084d7a 100644 --- a/libp2p/stream_muxer/abc.py +++ b/libp2p/stream_muxer/abc.py @@ -1,5 +1,5 @@ from abc import ABC, abstractmethod -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Optional from multiaddr import Multiaddr @@ -56,6 +56,12 @@ class IMuxedConn(ABC): :return: message read """ + @abstractmethod + async def read_buffer_nonblocking(self, stream_id: int) -> Optional[bytes]: + """ + Read a message from `stream_id`'s buffer, non-blockingly. + """ + @abstractmethod async def open_stream( self, protocol_id: str, multi_addr: Multiaddr