mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 08:00:54 +00:00
remove if TYPE_CHECKING as much as possible
This commit is contained in:
@ -1,14 +1,11 @@
|
||||
import asyncio
|
||||
from typing import TYPE_CHECKING
|
||||
from libp2p.stream_muxer.muxed_stream_interface import IMuxedStream
|
||||
from libp2p.stream_muxer.muxed_connection_interface import IMuxedConn
|
||||
|
||||
|
||||
from .constants import HeaderTags
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from libp2p.stream_muxer.muxed_connection_interface import IMuxedConn
|
||||
|
||||
|
||||
class MplexStream(IMuxedStream):
|
||||
"""
|
||||
reference: https://github.com/libp2p/go-mplex/blob/master/stream.go
|
||||
@ -16,16 +13,14 @@ class MplexStream(IMuxedStream):
|
||||
|
||||
stream_id: int
|
||||
initiator: bool
|
||||
mplex_conn: "IMuxedConn"
|
||||
mplex_conn: IMuxedConn
|
||||
read_deadline: float
|
||||
write_deadline: float
|
||||
local_closed: bool
|
||||
remote_closed: bool
|
||||
stream_lock: asyncio.Lock
|
||||
|
||||
def __init__(
|
||||
self, stream_id: int, initiator: bool, mplex_conn: "IMuxedConn"
|
||||
) -> None:
|
||||
def __init__(self, stream_id: int, initiator: bool, mplex_conn: IMuxedConn) -> None:
|
||||
"""
|
||||
create new MuxedStream in muxer
|
||||
:param stream_id: stream stream id
|
||||
|
||||
Reference in New Issue
Block a user