add still needed TYPE_CHECK

This commit is contained in:
Chih Cheng Liang
2019-08-05 10:35:56 +08:00
parent 87ef2e4618
commit 29091266fc
6 changed files with 22 additions and 12 deletions

View File

@ -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