99from threading import Event
1010from threading import Thread
1111
12- import zmq .asyncio
12+ from zmq .asyncio import Context
13+ from zmq .asyncio import Socket
1314
1415from .channelsabc import HBChannelABC
1516from .session import Session
@@ -49,7 +50,7 @@ class HBChannel(Thread):
4950
5051 def __init__ (
5152 self ,
52- context : t .Optional [zmq . asyncio . Context ] = None ,
53+ context : t .Optional [Context ] = None ,
5354 session : t .Optional [Session ] = None ,
5455 address : t .Union [t .Tuple [str , int ], str ] = "" ,
5556 ):
@@ -193,7 +194,7 @@ def call_handlers(self, since_last_heartbeat: float) -> None:
193194class ZMQSocketChannel (object ):
194195 """A ZMQ socket in an async API"""
195196
196- def __init__ (self , socket : zmq . asyncio . Socket , session : Session , loop : t .Any = None ) -> None :
197+ def __init__ (self , socket : Socket , session : Session , loop : t .Any = None ) -> None :
197198 """Create a channel.
198199
199200 Parameters
@@ -207,7 +208,7 @@ def __init__(self, socket: zmq.asyncio.Socket, session: Session, loop: t.Any = N
207208 """
208209 super ().__init__ ()
209210
210- self .socket : t .Optional [zmq . asyncio . Socket ] = socket
211+ self .socket : t .Optional [Socket ] = socket
211212 self .session = session
212213
213214 async def _recv (self , ** kwargs : t .Any ) -> t .Dict [str , t .Any ]:
0 commit comments