mypy: Add read_buffer_nonblocking
in Mplex
This commit is contained in:
parent
f281e3e1db
commit
e37b8bcf19
|
@ -1,5 +1,4 @@
|
||||||
import coincurve
|
import coincurve
|
||||||
|
|
||||||
from libp2p.crypto.keys import KeyPair, KeyType, PrivateKey, PublicKey
|
from libp2p.crypto.keys import KeyPair, KeyType, PrivateKey, PublicKey
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING, Optional
|
||||||
|
|
||||||
from multiaddr import Multiaddr
|
from multiaddr import Multiaddr
|
||||||
|
|
||||||
|
@ -56,6 +56,12 @@ class IMuxedConn(ABC):
|
||||||
:return: message read
|
: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
|
@abstractmethod
|
||||||
async def open_stream(
|
async def open_stream(
|
||||||
self, protocol_id: str, multi_addr: Multiaddr
|
self, protocol_id: str, multi_addr: Multiaddr
|
||||||
|
|
Loading…
Reference in New Issue
Block a user