mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-03-21 20:51:27 +00:00
add still needed TYPE_CHECK
This commit is contained in:
@ -19,6 +19,7 @@ from .network_interface import INetwork
|
||||
from .notifee_interface import INotifee
|
||||
from .stream.net_stream import NetStream
|
||||
from .stream.net_stream_interface import INetStream
|
||||
from .typing import GenericProtocolHandlerFn
|
||||
|
||||
StreamHandlerFn = Callable[[INetStream], Awaitable[None]]
|
||||
|
||||
@ -248,9 +249,6 @@ class Swarm(INetwork):
|
||||
# TODO: `disconnect`?
|
||||
|
||||
|
||||
GenericProtocolHandlerFn = Callable[[IMuxedStream], Awaitable[None]]
|
||||
|
||||
|
||||
def create_generic_protocol_handler(swarm: Swarm) -> GenericProtocolHandlerFn:
|
||||
"""
|
||||
Create a generic protocol handler from the given swarm. We use swarm
|
||||
|
||||
4
libp2p/network/typing.py
Normal file
4
libp2p/network/typing.py
Normal file
@ -0,0 +1,4 @@
|
||||
from typing import Awaitable, Callable
|
||||
from libp2p.stream_muxer.muxed_stream_interface import IMuxedStream
|
||||
|
||||
GenericProtocolHandlerFn = Callable[[IMuxedStream], Awaitable[None]]
|
||||
Reference in New Issue
Block a user