Show More
@@ -170,20 +170,3 b' class HeartMonitor(LoggingConfigurable):' | |||
|
170 | 170 | else: |
|
171 | 171 | self.log.warn("heartbeat::got bad heartbeat (possibly old?): %s (current=%.3f)", msg[1], self.lifetime) |
|
172 | 172 | |
|
173 | ||
|
174 | if __name__ == '__main__': | |
|
175 | loop = ioloop.IOLoop.instance() | |
|
176 | context = zmq.Context() | |
|
177 | pub = context.socket(zmq.PUB) | |
|
178 | pub.bind('tcp://127.0.0.1:5555') | |
|
179 | router = context.socket(zmq.ROUTER) | |
|
180 | router.bind('tcp://127.0.0.1:5556') | |
|
181 | ||
|
182 | outstream = zmqstream.ZMQStream(pub, loop) | |
|
183 | instream = zmqstream.ZMQStream(router, loop) | |
|
184 | ||
|
185 | hb = HeartMonitor(loop=loop, pingstream=outstream, pongstream=instream) | |
|
186 | import logging | |
|
187 | hb.log.setLevel(logging.DEBUG) | |
|
188 | hb.start() | |
|
189 | loop.start() |
General Comments 0
You need to be logged in to leave comments.
Login now