99from threading import Event
1010from threading import Thread
1111
12- import zmq .asyncio
12+ import zmq
13+ from zmq .asyncio import Context
14+ from zmq .asyncio import Socket
1315
1416from .channelsabc import HBChannelABC
1517from .session import Session
@@ -49,7 +51,7 @@ class HBChannel(Thread):
4951
5052 def __init__ (
5153 self ,
52- context : t .Optional [zmq . asyncio . Context ] = None ,
54+ context : t .Optional [Context ] = None ,
5355 session : t .Optional [Session ] = None ,
5456 address : t .Union [t .Tuple [str , int ], str ] = "" ,
5557 ):
@@ -193,7 +195,7 @@ def call_handlers(self, since_last_heartbeat: float) -> None:
193195class ZMQSocketChannel (object ):
194196 """A ZMQ socket in an async API"""
195197
196- def __init__ (self , socket : zmq . asyncio . Socket , session : Session , loop : t .Any = None ) -> None :
198+ def __init__ (self , socket : Socket , session : Session , loop : t .Any = None ) -> None :
197199 """Create a channel.
198200
199201 Parameters
@@ -207,7 +209,7 @@ def __init__(self, socket: zmq.asyncio.Socket, session: Session, loop: t.Any = N
207209 """
208210 super ().__init__ ()
209211
210- self .socket : t .Optional [zmq . asyncio . Socket ] = socket
212+ self .socket : t .Optional [Socket ] = socket
211213 self .session = session
212214
213215 async def _recv (self , ** kwargs : t .Any ) -> t .Dict [str , t .Any ]:
0 commit comments