##// END OF EJS Templates
SUB channel _handle_recv is now greedy....
Brian Granger -
Show More
@@ -102,11 +102,19 b' class SubSocketChannel(ZmqSocketChannel):'
102
102
103 def _handle_err(self):
103 def _handle_err(self):
104 # We don't want to let this go silently, so eventually we should log.
104 # We don't want to let this go silently, so eventually we should log.
105 raise zmq.ZmqError()
105 raise zmq.ZMQError()
106
106
107 def _handle_recv(self):
107 def _handle_recv(self):
108 msg = self.socket.recv_json()
108 # Get all of the messages we can
109 self.call_handlers(msg)
109 while True:
110 try:
111 msg = self.socket.recv_json(zmq.NOBLOCK)
112 except zmq.ZMQError:
113 # Check the errno?
114 # Will this tigger POLLERR?
115 break
116 else:
117 self.call_handlers(msg)
110
118
111 def call_handlers(self, msg):
119 def call_handlers(self, msg):
112 """This method is called in the ioloop thread when a message arrives.
120 """This method is called in the ioloop thread when a message arrives.
@@ -194,7 +202,7 b' class XReqSocketChannel(ZmqSocketChannel):'
194
202
195 def _handle_err(self):
203 def _handle_err(self):
196 # We don't want to let this go silently, so eventually we should log.
204 # We don't want to let this go silently, so eventually we should log.
197 raise zmq.ZmqError()
205 raise zmq.ZMQError()
198
206
199 def _queue_request(self, msg, callback):
207 def _queue_request(self, msg, callback):
200 handler = self._find_handler(msg['msg_type'], callback)
208 handler = self._find_handler(msg['msg_type'], callback)
General Comments 0
You need to be logged in to leave comments. Login now