99from threading import Event
1010from threading import Thread
1111
12- import zmq .asyncio
12+ from zmq .asyncio import Context , Socket
1313
1414from .channelsabc import HBChannelABC
1515from .session import Session
@@ -49,7 +49,7 @@ class HBChannel(Thread):
4949
5050 def __init__ (
5151 self ,
52- context : t .Optional [zmq . asyncio . Context ] = None ,
52+ context : t .Optional [Context ] = None ,
5353 session : t .Optional [Session ] = None ,
5454 address : t .Union [t .Tuple [str , int ], str ] = "" ,
5555 ):
@@ -193,7 +193,9 @@ def call_handlers(self, since_last_heartbeat: float) -> None:
193193class ZMQSocketChannel (object ):
194194 """A ZMQ socket in an async API"""
195195
196- def __init__ (self , socket : zmq .asyncio .Socket , session : Session , loop : t .Any = None ) -> None :
196+ def __init__ (
197+ self , socket : Socket , session : Session , loop : t .Any = None
198+ ) -> 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