9
9
from threading import Event
10
10
from threading import Thread
11
11
12
- import zmq .asyncio
12
+ from zmq .asyncio import Context
13
+ from zmq .asyncio import Socket
13
14
14
15
from .channelsabc import HBChannelABC
15
16
from .session import Session
@@ -49,7 +50,7 @@ class HBChannel(Thread):
49
50
50
51
def __init__ (
51
52
self ,
52
- context : t .Optional [zmq . asyncio . Context ] = None ,
53
+ context : t .Optional [Context ] = None ,
53
54
session : t .Optional [Session ] = None ,
54
55
address : t .Union [t .Tuple [str , int ], str ] = "" ,
55
56
):
@@ -193,7 +194,7 @@ def call_handlers(self, since_last_heartbeat: float) -> None:
193
194
class ZMQSocketChannel (object ):
194
195
"""A ZMQ socket in an async API"""
195
196
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 :
197
198
"""Create a channel.
198
199
199
200
Parameters
@@ -207,7 +208,7 @@ def __init__(self, socket: zmq.asyncio.Socket, session: Session, loop: t.Any = N
207
208
"""
208
209
super ().__init__ ()
209
210
210
- self .socket : t .Optional [zmq . asyncio . Socket ] = socket
211
+ self .socket : t .Optional [Socket ] = socket
211
212
self .session = session
212
213
213
214
async def _recv (self , ** kwargs : t .Any ) -> t .Dict [str , t .Any ]:
0 commit comments